Sending email from a webpage using ASP

Any scripts which are required to send emails via our system will need to use the outgoing email server of ‘localhost’. In .NET code, the following should work fine: System.Web.Mail.SmtpMail.SmtpServer = “localhost”.

Emails which are not sent to the ‘localhost’ server will fail.

Windows IIS servers for MS ASP users – W3Jmail component

For customers on the Windows server, wishing to send email from a webpage, we recommend you use the following code.

<%@LANGUAGE = VBSCRIPT%>

 <html> <body>

 <%

 DIM strEmail, strFirstName, strLastName, strSubject, strComments, Mailer

         strEmail = Request.Form("Email")         strFirstName = Request.Form("FirstName")         strLastName = Request.Form("LastName")         strSubject = Request.Form("Subject")         strComments = Request.Form("Comments")

 set msg = Server.CreateOBject( "JMail.Message" )

         msg.From = strEmail         msg.FromName = strFirstName

                 msg.AddRecipient "user@domain.com" <mailto:user@domain.com> 

         msg.Subject = strSubject         msg.Body = Comments

                 if not msg.Send("localhost" ) then                 Response.write "<pre>" & msg.log & "</pre>"

                         else

                                 Response.write "Message sent succesfully!"

                         end if

 %>