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

ASPMail not recognizing a recordset as a recipient

Status
Not open for further replies.

rodrigosalinas

Technical User
Jun 28, 2002
4
US
using dreamweaver I inserted information in database, and after inserting info, user is redirected to a thank you page where he can see all the info submitted. in the thank you page, I have a recordset based in the last insterted record. I'm using ASPMAIL and I can't send the mail to the user. code I'm using:

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName   = "mysite.com"
Mailer.FromAddress = "webmaster@mysite.com"
Mailer.AddRecipient rs_users.Fields.Item("name").Value, rs_users.Fields.Item("email").Value
Mailer.RemoteHost = "mail.mysite.com"
Mailer.ReplyTo = "webmaster@mysite.com"
Mailer.Subject    = "Your order at Mailer.BodyText   = msgBody

BUT i'm getting the error message:

Type mismatch: 'Mailer.AddRecipient'

any advice will be appreciated.
 
take out "rs_users.Fields.Item("name").Value, "

Cheech

[Peace][Pipe]
 
I can't take ot that line because aspmail requires for the recipient to have a name and email. any more ideas?
 
this is a stab in the dark but you're missing the = on that line


logo.gif width='75' height='15'
 
use variables assigned to values of RS.
Code:
<%' *** E-mail Vars
  Dim strFirstName
  Dim strEmail
  Dim strAccountName
  Dim strAccountPassword
     strFirstName = Users.Fields.Item(&quot;FirstName&quot;).Value
     strEmail = Users.Fields.Item(&quot;Email&quot;).Value
     strAccountName = Users.Fields.Item(&quot;UserName&quot;).Value
     strAccountPassword = Users.Fields.Item(&quot;Password&quot;).Value
%>
<%' *** SEND MAIL
Dim objCDO
Set objCDO = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
objCDO.From = &quot;SOMEONE&quot;
objCDO.To = strEmail
objCDO.Subject = &quot;Thank you for registering with [URL unfurl="true"]http://mysite.com&quot;[/URL]
objCDO.BodyFormat = 0 
objCDO.MailFormat = 0 
objCDO.Body = &quot;<font face='Arial' size ='3'>&quot; &_
&quot;WELCOME &quot; & strFirstName & &quot;!&quot; &_
&quot;<br>&quot; &_
&quot;Thank you for registering with mysite&quot; &_

All the best!

> need more info?
:: don't click HERE ::
 
also try recipient format of:
User <user_email@site.com>, User2 <user_2@site.com>

All the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top