// Initialize WebMail helper
WebMail.SmtpServer = "your-SMTP-host";????
WebMail.SmtpPort = 25;????
WebMail.UserName = "your-user-name-here";????
WebMail.Password = "your-account-password";???
WebMail.From = "your-email-address-here";????
? Add a new page named ProcessRequest.cshtml to the website and add the following code and markup:
@{
var customerName = Request["customerName"];
var customerEmail = Request["customerEmail"];
var customerRequest = Request["customerRequest"];
var errorMessage = "";
var debuggingFlag = false;
try {
// Initialize WebMail helper
WebMail.SmtpServer = "your-SMTP-host";
WebMail.SmtpPort = 25;
WebMail.UserName = "your-user-name-here";
WebMail.Password = "your-account-password";
WebMail.From = "your-email-address-here";
// Send email
WebMail.Send(to: customerEmail,
subject: "Help request from - " + customerName,
body: customerRequest
);
}
catch (Exception ex ) {
errorMessage = ex.Message;
}
}
Sorry to hear that you are having trouble, @customerName.
@if(errorMessage == ""){
An email message has been sent to our customer service
department regarding the following problem:
@customerRequest
}
else{
The email was not sent.
Please check that the code in the ProcessRequest page has
correct settings for the SMTP server name, a user name,
a password, and a "from" address.
if(debuggingFlag){
The following error was reported:
@errorMessage
}
}


Nitin SontakkeRank #264 · 9.6K reputationPosted Aug 9, 2016, 10:27 PM EDT
Vinay SinghRank #604 · 4K reputationPosted Aug 10, 2016, 12:39 AM EDT
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Aug 10, 2016, 1:13 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Aug 10, 2016, 1:19 AM EDT
Ananth GRank #1,176 · 1.5K reputationPosted Oct 21, 2016, 1:39 AM EDT
Manimekalai GanesanRank #1,304 · 1.3K reputationPosted Nov 14, 2016, 10:40 PM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Nov 14, 2016, 10:51 PM EST