#1
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jul 2005
    Posts
    78
    Rep Power
    13

    Thumbs up Problem with form of aspemail contact


    Hi, I come facing a problem to send a aspemail formulario for my site, I readjusted the formulario in accordance with my necessities, but it lives giving errors... He sees the error below...

    Error>>

    Error encountered: 501 Syntax error in parameters or arguments

    Please they help me because I already tried of everything and nothing he gives certain, obliged.

    [code]


    <%
    ' Check to see if the "EmailTo" field as filled out, if it was, assume
    ' all other fields were filled out and try to send email
    If Len(Request("EmailTo")) > 0 Then

    ' Instantiate the COM Object
    Set Mail = Server.CreateObject("Persits.MailSender")


    ' This is the Active Server Internal SMTP Address
    Mail.Host = "mail.ivoce.com"


    ' This is the Active Server Internal SMTP Port
    Mail.Port = "25"


    ' This is the Reply To email address
    Request.Form("ReplyTo")


    ' This is who the email will be sent to
    Request.Form("EmailTo")
    Request.Form("Contato TV Cidade Azul")


    ' This is the SUBJECT of the email
    Request.Form("Subject")


    ' This is the BODY of the email
    Request.Form("Body")

    Mail.Username = "i@ivoce.com"
    Mail.Password = "123"


    ' This is Error Checking and the "Mail.Send" is the actual action of sending the email
    On Error Resume Next
    Mail.Send
    If Err <> 0 Then
    Response.Write "Error encountered: " & Err.Description
    Else
    Response.Write "Mail Sent Successfully."
    End If
    Else%>

    <form name="form1">

    <table>
    <tr>
    <td colspan="2"><b>ASPEmail Sample</b></td>
    </tr>
    <tr>
    <td valign="top">E-mail:</td>
    <td> <input type="text" name="ReplyTo"> </td>
    </tr>
    <tr>
    <td valign="top">Selecione:</td>
    <td><select name="EmailTo" id="EmailTo">
    <option value="junior@tvcidadeazul.com.br">Videografismo</option>
    <option value="tv@tvcidadeazul.com.br">Geral</option>
    </select></td>
    </tr>
    <tr>
    <td valign="top">Nome:</td>
    <td> <input type="text" name="EmailToName"> </td>
    </tr>
    <tr>
    <td valign="top">Assunto:</td>
    <td> <input type="text" name="Subject"> </td>
    </tr>
    <tr>
    <td valign="top">Mensagem:</td>
    <td> <textarea cols="40" rows="10" name="Body"></textarea> </td>
    </tr>
    <tr>
    <td></td>
    <td> <input type="submit" value="Send Email"> </td>
    </tr>
    </table>
    </form>

    <%End If%>

    [code]
  2. #2
  3. Contributing User
    ASP Hero (2000 - 2499 posts)

    Join Date
    Nov 2003
    Location
    UK
    Posts
    2,280
    Rep Power
    314

    Problem with form of aspemail contact


    you need to set it up something like:

    Code:
    <%
    If Request("EmailTo") <> "" Then
    	Set Mail = Server.CreateObject("Persits.MailSender")
    
    	Mail.Host = "mail.ivoce.com"
    	Mail.Port = "25"
    	Mail.From = Request.Form("ReplyTo")
    	Mail.AddReplyTo Request.Form("ReplyTo")
    	Mail.AddAddress Request.Form("EmailTo")
    	Mail.AddCC Request.Form("Contato TV Cidade Azul")
    	Mail.Subject = Request.Form("Subject")
    	Mail.Body = Request.Form("Body")
    	Mail.Username = "i@ivoce.com"
    	Mail.Password = "123"
    
    	On Error Resume Next
    	Mail.Send
    	If Err <> 0 Then
    		Response.Write "Error encountered: " & Err.Description
    	Else
    		Response.Write "Mail Sent Successfully."
    	End If
    Else
    %>
    <htnl>
    <head>
    </head>
    <body>
    <form name="form1" action="THIS_PAGE_NAME.asp" method="post">
    ...........
    Hope this advise helps.

    If so please show your appreciation by adding reputation points (click gauge image on top right of this post and score).

Similar Threads

  1. Problem with File upload and Form components
    By JimFL in forum ASP Development
    Replies: 4
    Last Post: April 14th, 2005, 12:51 PM
  2. Submit Form data and refresh form
    By Bemused in forum ASP Development
    Replies: 6
    Last Post: April 5th, 2005, 03:40 AM
  3. ASP form - Mac Email Problem
    By PSK in forum Code Bank
    Replies: 6
    Last Post: October 25th, 2004, 02:34 PM
  4. Coding Problem with form List Box
    By tim95030 in forum Microsoft Access Help
    Replies: 2
    Last Post: October 20th, 2004, 03:50 PM
  5. Problem copying form after using Security Wizard
    By solepixel in forum Microsoft Access Help
    Replies: 1
    Last Post: June 15th, 2004, 02:45 PM

IMN logo majestic logo threadwatch logo seochat tools logo