Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending a personalised email (ASP)

Status
Not open for further replies.

Jeremy74

IS-IT--Management
Nov 21, 2001
56
GB
I have a form on my site where users can join my site and receive newsletters etc, this is attached to an access database. What I want to do is automatically send them a personalised email that includes their name (ie Dear John) and password. It also has to send a copy to me. I have a good host with ASPmail, CDO and auto responders. What’s the easiest way to do this? I was looking at using the CDO extension by Ray West but can’t find a tutorial on this. Can someone point me in the right direction with some good advice or Tutorials?

Cheers

Jeremy
 
[tt]
Here's the way I do it:

When my user(s) want to email anyone I have them fill this html form already populated by the database then posting it to my email processing page but passing the user(s) database ID field as shown below:

then on my email page, I create a recordset requesting all members with the ID in the URL (the one I'm passing) to get the perfect match. Then I simply customize the email as I please.

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%
dim mystring
mystring = &quot;%>
<!--#include file=&quot;Connections/myconnection.asp&quot; -->
<%
Dim rsEmail__MMColParam
rsEmail__MMColParam = &quot;1&quot;
if (Request.QueryString(&quot;id&quot;) <> &quot;&quot;) then rsEmail__MMColParam = Request.QueryString(&quot;id&quot;)
%>
<%
set rsEmail = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsEmail.ActiveConnection = MM_Mentor_STRING
rsEmail.Source = &quot;SELECT * FROM Users WHERE id = &quot; + Replace(rsEmail__MMColParam, &quot;'&quot;, &quot;''&quot;) + &quot;&quot;
rsEmail.CursorType = 0
rsEmail.CursorLocation = 2
rsEmail.LockType = 3
rsEmail.Open()
rsEmail_numRows = 0
%>
<HTML>
<HEAD>
<TITLE>My Company's automated email system</TITLE>
</HEAD>
<BODY>
<%
Dim objMsg, strFrom, strTo, strSubject, strBody, lngImportance, objMail, htmlText
strFrom = request.form(&quot;email&quot;)
(&quot;supervisor&quot;) & &quot;;&quot; & request.form(&quot;management&quot;) & &quot;;&quot; & request.form(&quot;name&quot;) & &quot;me@myisp.com&quot;

strTo = &quot;me@myisp.com&quot;

strSubject = &quot;Hello &quot; & RsEmail(&quot;User&quot;) & &quot; Thank you for joining my site&quot;
strBody = &quot; blah, blah blah blah&quot;

Set objMsg = Server.CreateObject(&quot;CDONTS.NewMail&quot;)

objMsg.From = strFrom
objMsg.To = strTo
objMsg.Subject = strSubject
objMsg.Body = strBody
objMsg.Send
Set objMsg = Nothing
%>


<HR>
<script language=&quot;JavaScript&quot;>
ovhref.click()
</script>
<%
rsEmail.Close()
%>



Hope it helps...


[tt]&quot;A Successful man is one who can build
a firm foundation with the bricks
that others throw at him&quot;
[/tt]

banana.gif
rockband.gif
banana.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top