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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with ultradev / aspemail

Status
Not open for further replies.

aamaker

Programmer
Joined
Jan 20, 2002
Messages
222
Location
US
Im delving into some of the more advanced ultradev ASP development capabilities and have built my own user registration application... Im attempting to finish it off by having ASPEmail, upon confirmation of registration, send the registrant a verification email message.

I have it working but cant figure out how to declare session variables in the BODY of the message...(to provide their login information - user/password)

To declare the users email address, Im using:

Mail.AddAddress rsConfirmed.Fields.Item("Email").Value

I get syntax errors when I try to use the same/similar in the area for the body of the email message -- does anyone know how to do this?

-A

 
Hey A,

You bet, it is very similiar to Jmail and I'm sure CDonts. Heres what you do.

First off you have someone fill out a form. Then it's a cool thing to send the form results to a confirmation page.
a "this is what you put in" type of thing.

Put this below your recordset and modify to fit your needs.

+++++++++++++
<%
Dim strTitle
Dim strFirst_Name
Dim strLast_Name
Dim strAddress
Dim strCity
Dim strState
Dim strZip
Dim strHomePhone
Dim strWorkPhone
Dim strEMail
Dim strStock
Dim strVIN
Dim strColor
Dim strTrim
Dim strModelName
Dim strModelNumber

strTitle = rsSubmitConfirm.Fields.Item(&quot;Title&quot;).Value
strFirst_Name = rsSubmitConfirm.Fields.Item(&quot;First_Name&quot;).Value
StrLast_Name = rsSubmitConfirm.Fields.Item(&quot;Last_Name&quot;).Value
strAddress = rsSubmitConfirm.Fields.Item(&quot;Address&quot;).Value
strCity = rsSubmitConfirm.Fields.Item(&quot;City&quot;).Value
strState = rsSubmitConfirm.Fields.Item(&quot;State&quot;).Value
strZip = rsSubmitConfirm.Fields.Item(&quot;Zip&quot;).Value
strHomePhone = rsSubmitConfirm.Fields.Item(&quot;Home_Phone&quot;).Value
strWorkPhone = rsSubmitConfirm.Fields.Item(&quot;Work_Phone&quot;).Value
strEMail = rsSubmitConfirm.Fields.Item(&quot;Email&quot;).Value
strStock = rsSubmitConfirm.Fields.Item(&quot;Stock&quot;).Value
strVIN = rsSubmitConfirm.Fields.Item(&quot;VIN&quot;).Value
strColor = rsSubmitConfirm.Fields.Item(&quot;Color&quot;).Value
strTrim = rsSubmitConfirm.Fields.Item(&quot;Trim&quot;).Value
strModelName = rsSubmitConfirm.Fields.Item(&quot;ModelName&quot;).Value
strModelNumber = rsSubmitConfirm.Fields.Item(&quot;ModelNumber&quot;).Value
strLocation = rsSubmitConfirm.Fields.Item(&quot;Location&quot;).Value
%>
<%
Set Mailer = Server.CreateObject(&quot;SMTPsvg.Mailer&quot;)
Mailer.FromName = &quot;Anything works here&quot;
Mailer.FromAddress= &quot;youremail@yourdomain.com&quot;
Mailer.RemoteHost = &quot;yourSMTP@yourdomain.com&quot;
Mailer.AddRecipient strRecipient
Mailer.Subject = &quot;Subject Line&quot;
Mailer.BodyText = &quot;Top Body Text&quot;
Mailer.BodyText = &quot;&quot;
Mailer.BodyText = &quot;More Body Text&quot;
Mailer.BodyText = &quot;&quot;
Mailer.BodyText = &quot;More Body Text&quot;
Mailer.BodyText = &quot;Title - &quot; & strTitle
Mailer.BodyText = &quot;First_Name - &quot; & strFirst_Name
Mailer.BodyText = &quot;Last_Name - &quot; & strLast_Name
Mailer.BodyText = &quot;Address - &quot; & strAddress
Mailer.BodyText = &quot;City - &quot; & strCity
Mailer.BodyText = &quot;State - &quot; & strState
Mailer.BodyText = &quot;Zip - &quot; & strZip
Mailer.BodyText = &quot;Home Phone - &quot; & strHomePhone
Mailer.BodyText = &quot;Work Phone - &quot; & strWorkPhone
Mailer.BodyText = &quot;Email Address - &quot; & strEMail
Mailer.BodyText = &quot;Stock # - &quot; & strStock
Mailer.BodyText = &quot;Model Number - &quot; & strModelNumber
Mailer.BodyText = &quot;Model Name - &quot; & strModelName
Mailer.BodyText = &quot;Trim - &quot; & strTrim
Mailer.BodyText = &quot;VIN # - &quot; & strVIN
Mailer.BodyText = &quot;Color - &quot; & strColor
Mailer.BodyText = &quot;Location -&quot; & strLocation
if Mailer.SendMail then
Response.Write &quot;Mail sent...&quot;
else
Response.Write &quot;Mail send failure. Error was &quot; & Mailer.Response
end if
%>

+++++++++++++++++++
Obviously your fields will change. But you can see the path. Up top we do strXXXXXXXXXX = the form field name.
Then you call that strXXXXXXXX in the email section.

Hollar if you run into problems :-0 &quot;If you feel a post has been helpful to you, click on the link at the bottom of their post to cast a vote for &quot;TipMaster Of The Week&quot;. You don't need to be the one who asked the question to vote&quot;

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top