-
Can anybody let me know the code i've given below is sufficient or not for sending E-Mail on the net If yes then i would like to tell u that it is not working properly It is just sending the message "Mail Sent Successfully" as i used for success message but i'm not receiving the mail at my id as i've defined "manoj.manojbisht@gmail.com" But i'm still confused about "SMTP SERVER" i've kept it blank. Should i use something else if yes plz let me know.................................................................................................................................................... MailMessage mail=new MailMessage(); mail.To="manoj.manojbisht@gmail.com"; mail.From="msb1984_620@yahoo.com"; mail.Subject="Manoj Bisht"; mail.Priority=MailPriority.High; mail.Body="Hello How R U"; try { SmtpMail.SmtpServer=""; SmtpMail.Send(mail); //Response.Write("Mail Sent Successfully"); lblMsg.Text="Mail Sent Succesffully"; lblMsg.ForeColor=Color.DarkBlue; } catch(Exception ex) { Response.Write("Message Failed"); }
-
Can anybody let me know the code i've given below is sufficient or not for sending E-Mail on the net If yes then i would like to tell u that it is not working properly It is just sending the message "Mail Sent Successfully" as i used for success message but i'm not receiving the mail at my id as i've defined "manoj.manojbisht@gmail.com" But i'm still confused about "SMTP SERVER" i've kept it blank. Should i use something else if yes plz let me know.................................................................................................................................................... MailMessage mail=new MailMessage(); mail.To="manoj.manojbisht@gmail.com"; mail.From="msb1984_620@yahoo.com"; mail.Subject="Manoj Bisht"; mail.Priority=MailPriority.High; mail.Body="Hello How R U"; try { SmtpMail.SmtpServer=""; SmtpMail.Send(mail); //Response.Write("Mail Sent Successfully"); lblMsg.Text="Mail Sent Succesffully"; lblMsg.ForeColor=Color.DarkBlue; } catch(Exception ex) { Response.Write("Message Failed"); }
Pls check the Spam Folder.
Regards, Satips.:rose:
-
Pls check the Spam Folder.
Regards, Satips.:rose:
-
Apply Break Point and check it whether it is blocked by your ISP or the code.
Regards, Satips.:rose:
-
Can anybody let me know the code i've given below is sufficient or not for sending E-Mail on the net If yes then i would like to tell u that it is not working properly It is just sending the message "Mail Sent Successfully" as i used for success message but i'm not receiving the mail at my id as i've defined "manoj.manojbisht@gmail.com" But i'm still confused about "SMTP SERVER" i've kept it blank. Should i use something else if yes plz let me know.................................................................................................................................................... MailMessage mail=new MailMessage(); mail.To="manoj.manojbisht@gmail.com"; mail.From="msb1984_620@yahoo.com"; mail.Subject="Manoj Bisht"; mail.Priority=MailPriority.High; mail.Body="Hello How R U"; try { SmtpMail.SmtpServer=""; SmtpMail.Send(mail); //Response.Write("Mail Sent Successfully"); lblMsg.Text="Mail Sent Succesffully"; lblMsg.ForeColor=Color.DarkBlue; } catch(Exception ex) { Response.Write("Message Failed"); }
try { string msgBody = ""; string configToAddresses = ""; string[] toAddressesArray; configToAddresses = ConfigurationManager.AppSettings["MSG_REQUEST_TO_EMAIL_ADDRESS"].Trim(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(ConfigurationManager.AppSettings["MSG_REQUEST_FROM_EMAIL_ADDRESS"].Trim()); toAddressesArray = configToAddresses.Split(';'); // Add to Addresses in email foreach (string toAddress in toAddressesArray) { msg.To.Add(new MailAddress(toAddress)); } if (ConfigurationManager.AppSettings["MSG_REQUEST_CC_EMAIL_ADDRESS"].Trim().Length > 0) { msg.CC.Add(new MailAddress(ConfigurationManager.AppSettings["MSG_REQUEST_CC_EMAIL_ADDRESS"].Trim())); } msg.Subject = ConfigurationManager.AppSettings["MSG_REQUEST_EMAIL_SUBJECT"].Trim() + " " + DateTime.Now; msgBody = ConfigurationManager.AppSettings["MSG_REQUEST_SALUTE_EMAIL"].Trim() + "\r\n\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_EMAIL_BODY_START"].Trim() + " " + this.txtName.Text.Trim() + " (" + this.txtEmail.Text.Trim() + ")"; if (this.txtOrganization.Text.Trim().Length > 0) { msgBody += " of " + this.txtOrganization.Text.Trim(); } msgBody += " on " + DateTime.Now + ". "; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_EMAIL_BODY_MIDDLE"].Trim() + "\r\n\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_SIGNATURE_EMAIL_URL"].Trim() + "\r\n\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_SIGNATURE_EMAIL"].Trim() + "\r\n\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_SIGNATURE_EMAIL_TEAM"].Trim() + "\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_SIGNATURE_EMAIL_TEAM_URL"].Trim(); msg.Body = msgBody; SmtpClient client = new SmtpClient(); client.Host = ConfigurationManager.AppSettings["SMTP_HOST"]; client.Port = int.Parse(ConfigurationManager.AppSettings["SMTP_PORT"]); client.Send(msg); } catch (System.Threading.ThreadAbortException ex) { } catch (Exception ex) { ConfigurationManager.AppSettings["DEFAULT_MESSAGE"] = ex.ToString(); Resp
-
try { string msgBody = ""; string configToAddresses = ""; string[] toAddressesArray; configToAddresses = ConfigurationManager.AppSettings["MSG_REQUEST_TO_EMAIL_ADDRESS"].Trim(); MailMessage msg = new MailMessage(); msg.From = new MailAddress(ConfigurationManager.AppSettings["MSG_REQUEST_FROM_EMAIL_ADDRESS"].Trim()); toAddressesArray = configToAddresses.Split(';'); // Add to Addresses in email foreach (string toAddress in toAddressesArray) { msg.To.Add(new MailAddress(toAddress)); } if (ConfigurationManager.AppSettings["MSG_REQUEST_CC_EMAIL_ADDRESS"].Trim().Length > 0) { msg.CC.Add(new MailAddress(ConfigurationManager.AppSettings["MSG_REQUEST_CC_EMAIL_ADDRESS"].Trim())); } msg.Subject = ConfigurationManager.AppSettings["MSG_REQUEST_EMAIL_SUBJECT"].Trim() + " " + DateTime.Now; msgBody = ConfigurationManager.AppSettings["MSG_REQUEST_SALUTE_EMAIL"].Trim() + "\r\n\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_EMAIL_BODY_START"].Trim() + " " + this.txtName.Text.Trim() + " (" + this.txtEmail.Text.Trim() + ")"; if (this.txtOrganization.Text.Trim().Length > 0) { msgBody += " of " + this.txtOrganization.Text.Trim(); } msgBody += " on " + DateTime.Now + ". "; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_EMAIL_BODY_MIDDLE"].Trim() + "\r\n\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_SIGNATURE_EMAIL_URL"].Trim() + "\r\n\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_SIGNATURE_EMAIL"].Trim() + "\r\n\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_SIGNATURE_EMAIL_TEAM"].Trim() + "\r\n"; msgBody += ConfigurationManager.AppSettings["MSG_REQUEST_SIGNATURE_EMAIL_TEAM_URL"].Trim(); msg.Body = msgBody; SmtpClient client = new SmtpClient(); client.Host = ConfigurationManager.AppSettings["SMTP_HOST"]; client.Port = int.Parse(ConfigurationManager.AppSettings["SMTP_PORT"]); client.Send(msg); } catch (System.Threading.ThreadAbortException ex) { } catch (Exception ex) { ConfigurationManager.AppSettings["DEFAULT_MESSAGE"] = ex.ToString(); Resp
-
Sir the code u sent me is it running properly i mean. Will i have to make any changes in web.config file If yes plz let me know I'm waiting for response by ur side
yes, yes, its working properly, but you have to define the msgs in web.config
Regards, Qaiser Nadeem
-
Sir the code u sent me is it running properly i mean. Will i have to make any changes in web.config file If yes plz let me know I'm waiting for response by ur side
should i send u the web msgs????
Regards, Qaiser Nadeem
-
should i send u the web msgs????
Regards, Qaiser Nadeem
-
if u still have any questions then plz come on q.nadeem@hotmail.com
Regards, Qaiser Nadeem
ASP.NET
10
Posts
3
Posters
0
Views
1
Watching