Knowledgebase: Samples Coding
ASP .NET CDOSYS
Posted by - NA - on 30 September 2010 12:58 PM
Issue

Not sure with settings of Formmail using ASP.NET


Symptoms

None


Cause


Lack of knowledge with the ASP.NET


Workaround

STEP 1: Open notepad and paste the following code to an aspx file after performing the necessary changes highlighted in red.

Subject - Subject of the Email
FromEmail - Sender Email Address, only from your domain email
ToEmail - Recipient Emaill Address
MessageBody - Email Message Contents
SMTPHostname - Either is localhost or mail.YOURDOMAINNAME
EmailID - One of your Email Login ID
EmailPassword - Password for the selected Email

<%@ Page Language="VB" %>
<%@ Import NameSpace="System.Web.Mail" %>

<%
 Dim Mail As New MailMessage
        Dim Msmtp As SmtpMail
        Mail.Priority = MailPriority.Normal
        Mail.To = "ToEmail"
        Mail.From = "FromEmail"
        Mail.Subject = "Subject"
        Mail.BodyFormat = MailFormat.Html
        Mail.Body = "MessageBody"
        Mail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTPHostname"
        Mail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 27
        Mail.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        Mail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        Mail.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "EmailID"
        Mail.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "EmailPassword"
 Msmtp.Send(Mail)

 Response.Write("Sent")

%>


Additional Information

If you are unable to resolve the problem above, kindly issue a ticket to Support Team.

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).