Sending email

Discussion in 'Classic ASP' started by nigel6772, Jan 27, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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= "[email protected]"
    Mailer.RemoteHost = "localhost"
    Mailer.AddRecipient Fname, Eamil
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Mailer.AddRecipient Fname, Eamil

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


    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= "[email protected]"
    Mailer.RemoteHost = "localhost"
    Mailer.AddRecipient Fname, Eamil

    </blockquote id="quote"></font id="quote">
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    From what you posted, it looks fine to me.
    quote:Originally posted by nigel6772

    Thanks for catching the typo.

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



    Mailer.AddRecipient Fname, Eamil

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


    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= "[email protected]"
    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">
     
  4. Thanks for catching the typo.

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



    Mailer.AddRecipient Fname, Eamil

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


    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= "[email protected]"
    Mailer.RemoteHost = "localhost"
    Mailer.AddRecipient Fname, Eamil

    </blockquote id="quote"></font id="quote">
    </blockquote id="quote"></font id="quote">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page