Groups

    ASP Script Help - NewMailObj

    im creating an email form which emails the form to 2 email address, but i cant get it working. it works fine when theres only onw email address.

    this is my code

    NewMailObj.To = request.form("email") & "[email protected]"

    anyone know what the correct code is

    6 Comments

    posting the whole code would be more helpful, but can't you add another email address in to the last part separated by ';' ?

    Original Poster

    suchafunkymonkey;7876722

    posting the whole code would be more helpful, but can't you add another … posting the whole code would be more helpful, but can't you add another email address in to the last part separated by ';' ?








    Message Sent



    'declare the variables that will receive the values
    'receive the values sent from the form and assign them to variables
    'note that request.form("name") will receive the value entered into the textfield
    'called name, and so with email and message
    Dim name, email, message, NewMailObj
    name=request.form("name")
    email=request.form("email")
    message=request.form("message")

    'create the mail object and send the details
    Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
    NewMailObj.From = "[email protected]"
    NewMailObj.To = request.form("email") and "[email protected]"
    NewMailObj.Subject = "Confirmation Email From Grants"
    NewMailObj.Body = "the name you entered was " & name & _
    "
    the email was " & email & _
    "
    the message was " & message

    'you need to add the following lines FOR the mail to be sent in HTML format
    NewMailObj.BodyFormat = 0
    NewMailObj.MailFormat = 0
    NewMailObj.Send
    'Close the email object and free up resources
    Set NewMailObj = nothing
    Response.write "The email was sent."
    %>

    You've created a variable called email in which you're placing the result from request.form("email"), but you never use this variable and do the request.form again. Use the email variable and combine it with the extra email address separated by ; as I said before or use newmailobj.cc or newmailobj.bcc and put the extra email in there.

    suchafunkymonkey;7876873

    You've created a variable called email in which you're placing the result … You've created a variable called email in which you're placing the result from request.form("email"), but you never use this variable and do the request.form again. Use the email variable and combine it with the extra email address separated by ; as I said before or use newmailobj.cc or newmailobj.bcc and put the extra email in there.



    ^

    Original Poster

    many thanks

    worked a treat with bcc
    Post a comment
    Avatar
    @
      Text
      Top Discussions
      1. Any PS4 News Here29213624
      2. So, whose already pre-ordered a Scorpio and where from?919
      3. Supermarket may have sold Sausages & Other Pork products may have been inf…1637
      4. Are these two things distinctly different to you?2590

      See more discussions