| |
thantos_kalev2001
Posts: 26
Score: 0
Joined: 8/31/2005
Status: offline
|
You could use something like this: <html> <head> <script language = "vbscript"> sub cmdSubmitForm_OnClick() Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Form Feedback from " & form1.txtName.value objMessage.Sender = "test@gmail.com" objMessage.To = "test@gmail.com" objMessage.TextBody = "Form Summary: " & form1.txtFeedback.value objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'SMTP Name or IP objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp_mail_server_name_here" 'Server port (usually 25) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'Port 25 is default, but you might have to enter another port number '****Option to add attachment objMessage.Configuration.Fields.Update objMessage.Send msgbox"Success!" end sub </script> </head> <BODY> <form name = "form1" method = "post"> <table border="1"> <tr> <td>Name:</td><td><input type = "text"name = "txtName"></td> </tr> <tr> <td>Message:</td><td><input type = "text" name = "txtFeedback" size="100"></td> </tr> <tr> <td><input type = "button" name = "cmdSubmitForm" value = "Submit"></td> </tr> </table> </form> </body> </html> Just save this as a .asp file and take a look at it in Internet Explorer. You will also have to add your smtp server name in the space specified, and you might have to change the smtp port number. Also, put in the email address that you want to send to. I tested it and it does work. I hope this helps! Thantos
|
|