PDA

View Full Version : Sending email


nigel6772
01-27-2004, 01:40 AM
Dim Fname
Dim Email
Dim Phome
Dim City
Dim State
Dim Country
Dim Nationality
Dim Comments

Dim cnnSimple ' ADO connection
Dim rstSimple ' ADO recordset
Set cnnSimple = Server.CreateObject("ADODB.Connection")

Set Fname=Request.Form("FirstName")
Set Lname=Request.Form("LastName")
Set Email=Request.Form("Email")

The above is part of a code that I am using to get information from a form and insert it into a database. Then I want to send an email to a recipient that submits the form.

Below is part of the code that I am using to send the email.
The SendMail fails because it does not recignize the Recipient.
How should I pass the recipient name and email addrss as variable?

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "FROMNAME"
Mailer.FromAddress= "from@emailaddress.com"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient Fname, Eamil

bruce
01-27-2004, 06:56 AM
Mailer.AddRecipient Fname, Eamil

Is this a typo 'eamil'? i think you are passing in the variable already


[b]quote:Originally posted by nigel6772

Dim Fname
Dim Email
Dim Phome
Dim City
Dim State
Dim Country
Dim Nationality
Dim Comments

Dim cnnSimple ' ADO connection
Dim rstSimple ' ADO recordset
Set cnnSimple = Server.CreateObject("ADODB.Connection")

Set Fname=Request.Form("FirstName")
Set Lname=Request.Form("LastName")
Set Email=Request.Form("Email")

The above is part of a code that I am using to get information from a form and insert it into a database. Then I want to send an email to a recipient that submits the form.

Below is part of the code that I am using to send the email.
The SendMail fails because it does not recignize the Recipient.
How should I pass the recipient name and email addrss as variable?

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "FROMNAME"
Mailer.FromAddress= "from@emailaddress.com"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient Fname, Eamil

</blockquote id="quote"></font id="quote">

bruce
02-18-2004, 03:50 AM
From what you posted, it looks fine to me.
[b]quote:Originally posted by nigel6772

Thanks for catching the typo.

So, you are saying the code I have should work?
[b]quote:Originally posted by bruce



Mailer.AddRecipient Fname, Eamil

Is this a typo 'eamil'? i think you are passing in the variable already


[b]quote:Originally posted by nigel6772

Dim Fname
Dim Email
Dim Phome
Dim City
Dim State
Dim Country
Dim Nationality
Dim Comments

Dim cnnSimple ' ADO connection
Dim rstSimple ' ADO recordset
Set cnnSimple = Server.CreateObject("ADODB.Connection")

Set Fname=Request.Form("FirstName")
Set Lname=Request.Form("LastName")
Set Email=Request.Form("Email")

The above is part of a code that I am using to get information from a form and insert it into a database. Then I want to send an email to a recipient that submits the form.

Below is part of the code that I am using to send the email.
The SendMail fails because it does not recignize the Recipient.
How should I pass the recipient name and email addrss as variable?

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "FROMNAME"
Mailer.FromAddress= "from@emailaddress.com"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient Fname, Eamil

</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">

nigel6772
02-18-2004, 10:32 AM
Thanks for catching the typo.

So, you are saying the code I have should work?
[b]quote:Originally posted by bruce



Mailer.AddRecipient Fname, Eamil

Is this a typo 'eamil'? i think you are passing in the variable already


[b]quote:Originally posted by nigel6772

Dim Fname
Dim Email
Dim Phome
Dim City
Dim State
Dim Country
Dim Nationality
Dim Comments

Dim cnnSimple ' ADO connection
Dim rstSimple ' ADO recordset
Set cnnSimple = Server.CreateObject("ADODB.Connection")

Set Fname=Request.Form("FirstName")
Set Lname=Request.Form("LastName")
Set Email=Request.Form("Email")

The above is part of a code that I am using to get information from a form and insert it into a database. Then I want to send an email to a recipient that submits the form.

Below is part of the code that I am using to send the email.
The SendMail fails because it does not recignize the Recipient.
How should I pass the recipient name and email addrss as variable?

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "FROMNAME"
Mailer.FromAddress= "from@emailaddress.com"
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient Fname, Eamil

</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">