How to send mail using company domain name???
For eg., [email protected] to [email protected]
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
venkata kumarRank #5,034 · 314 reputationPosted Feb 8, 2013, 1:39 AM EST
check fallowing
try{
string enableEmail = getValueFromList("EnableEmail").Trim();
if (enableEmail != null)
{
if ((enableEmail.ToString().Trim().ToUpper() != "T")
&&
(enableEmail.ToString().Trim().ToUpper() != "TRUE"))
{
return "Email sending is not enabled";
}
}
MailMessage msg = new MailMessage();
msg.From = new MailAddress("[email protected]");
msg.To.Add("[email protected]");
msg.Body = "Testing the automatic mail";
msg.IsBodyHtml = true;
msg.Subject = "Movie Data";
SmtpClient smt = new SmtpClient("web mail url like gmail (smtp.gmail.com)");
smt.Port = 587;
smt.Credentials = new NetworkCredential("[email protected]", "pasword");
smt.EnableSsl = true;
smt.Send(msg);
string script = "";
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "sendMail", script);
//return "Success";
}
catch (Exception ex)
{
throw ex;
}