SEND MAIL
-
Hello, plz help me i want to send email from asp.net web application in our godaddy server. .......................
-
Hello, plz help me i want to send email from asp.net web application in our godaddy server. .......................
-
Hello, plz help me i want to send email from asp.net web application in our godaddy server. .......................
For GoDaddy, you need to use: servername:
relay-hosting.secureserver.net
port:25
Thus, email code should be something like:MailMessage msg = new MailMessage();
msg.From = new MailAddress("myEmail@abc.com","My Company");
msg.To.Add("toFriends@abc.com");
msg.Subject = "My Subject";
msg.Body = "My Message";
msg.IsBodyHtml = true;// MailMessage instance to a specified SMTP server
SmtpClient smtp = new SmtpClient("relay-hosting.secureserver.net", 25);// Send the email
smtp.Send(msg);Sandeep Mewara [My last article]: Server side Delimiters in ASP.NET[^]
-
Hello, plz help me i want to send email from asp.net web application in our godaddy server. .......................
For GoDaddy, you need to use: servername:
relay-hosting.secureserver.net
port:25
Thus, email code should be something like:MailMessage msg = new MailMessage();
msg.From = new MailAddress("myEmail@abc.com","My Company");
msg.To.Add("toFriends@abc.com");
msg.Subject = "My Subject";
msg.Body = "My Message";
msg.IsBodyHtml = true;// MailMessage instance to a specified SMTP server
SmtpClient smtp = new SmtpClient("relay-hosting.secureserver.net", 25);// Send the email
smtp.Send(msg);Try!
Sandeep Mewara [My last article]: Server side Delimiters in ASP.NET[^]
-
Hello, plz help me i want to send email from asp.net web application in our godaddy server. .......................
this code have some chinese,if you know #region :Send Email /// /// Send Email(Success return true, faile retuan false) /// /// content /// theme /// send email /// send keys/param> /// get email /// Success return true, faile retuan false public static bool SendMail(string strBody, string strSubject, string strFrom, string strFromPwd, string strTo, string strSmtp) { bool b = false; // 邮件信息(属性) MailMessage mm = new MailMessage(); mm.From = new MailAddress(strFrom); mm.Subject = strSubject; mm.SubjectEncoding = Encoding.UTF8; mm.Body = strBody; mm.BodyEncoding = Encoding.UTF8; mm.IsBodyHtml = true; mm.Priority = MailPriority.Normal; //// 获取 SMTP 服务器 //string Smtp = string.Empty; // smtp 地址 //// 取得后部分的 smtp地址 //string strSmtp = strFrom.Substring((strFrom.IndexOf("@") + 1)); //Smtp = "smtp." + strSmtp; // 发送邮件 SmtpClient sc = new SmtpClient(strSmtp); // 用户凭证 (email 地址和密码) sc.Credentials = new NetworkCredential(strFrom, strFromPwd); if (strSmtp == "gmail.com") { sc.EnableSsl = true; } sc.Timeout = 5000; mm.To.Clear(); mm.To.Add(strTo); try { sc.Send(mm); b = true; } catch (ArgumentNullException ex) { b = false; } catch (SmtpException smtpEx) { b = false; } catch { b = false; } // 释放资源 mm.Dispose(); return b; } #endregion
-
Hello, plz help me i want to send email from asp.net web application in our godaddy server. .......................
Try this..I hope this what you want..Let us know if this doesn't solve your problem..
string strNoReplyEmail = "noreply@hotmail.com";
private void SendEMail(string strLastName, string strFirstName, string strEmail)
{MailMessage objMail = new MailMessage(strNoReplyEmail, strEmail); objMail.Subject = "Test Email"; objMail.Body = @"Dear " + strFirstName + " " + strLastName + ", \\n\\n" + "This is the test email. Please do not reply to this email." + " \\n\\n" + "Thank you," + "\\n" + "Administrator"; SmtpClient sc = new SmtpClient(); sc.Host = "www.hotmail.com"; sc.Send(objMail);
}
Dhyanga