adspace


How can we send mail using JavaScript?

Answer Posted / $lv@ganapathy.k

You can send via Using asp.net.
Use the following Assembly System.Web.Mail;

// Instantiate a new instance of MailMessage
MailMessage mMailMessage = new MailMessage();

// Set the sender address of the mail message
mMailMessage.From = new MailAddress(from);
// Set the recepient address of the mail message
mMailMessage.To.Add(new MailAddress(to));
// Check if the bcc value is null or an empty string
if ((bcc != null) && (bcc != string.Empty))
{
// Set the Bcc address of the mail message
mMailMessage.Bcc.Add(new MailAddress(bcc));
}

// Check if the cc value is null or an empty value
if ((cc != null) && (cc != string.Empty))
{
// Set the CC address of the mail message
mMailMessage.CC.Add(new MailAddress(cc));
} // Set the subject of the mail message
mMailMessage.Subject = subject;
// Set the body of the mail message
mMailMessage.Body = body;
// Set the format of the mail message body as HTML
mMailMessage.IsBodyHtml = true;
// Set the priority of the mail message to normal
mMailMessage.Priority = MailPriority.Normal;

// Instantiate a new instance of SmtpClient
SmtpClient mSmtpClient = new SmtpClient();
// Send the mail message
mSmtpClient.Send(mMailMessage);

Try to read Proxy address,username and password from
web.config file.

Is This Answer Correct ?    17 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me what kind of things have you done on the social side?

1071


List some features of php that are deprecated in php7?

1026


What is trait in php?

1072


What is the current stable version of php?

1130


How to calculate the difference between two dates using php?

1151


hello all, I need some sample placement papers in lion bridge.. can anyone help me?

2181


How to create a web form?

1116


sort term descripttion form, report and uery

2257


How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain

1082


What is difference between static and final in php?

1114


What is the current stable version of php? What advance thing in php7?

1100


Write a program using while loop?

1128


Explain me is it possible to destroy a cookie?

1035


What sized websites have you worked on in the past?

1092


Name and explain five of the PHP error constants?

1043