Last post Aug 06, 2014 06:06 AM by velambath
None
0 Points
1 Post
Aug 04, 2014 09:07 AM|vikasparmar88|LINK
if (ds.Tables[0].Rows.Count > 0) { MailMessage Msg = new MailMessage(); // Sender e-mail address. Msg.From = new MailAddress("vikasparmar88@gmail.com"); // Recipient e-mail address. Msg.To.Add(Temail.Text); Msg.Subject = "Check Password"; Msg.Body = "Hi, <br/>Please check your Login Detailss<br/><br/>Your Username: " + ds.Tables[0].Rows[0]["Name"] + "<br/><br/>Your Password: " + ds.Tables[0].Rows[0]["Password"] + "<br/><br/>"; Msg.IsBodyHtml = true; // your remote SMTP server IP. SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.Credentials = new System.Net.NetworkCredential("vikasparmar88@gmail.com", "vijaydas@1991"); smtp.EnableSsl = true;
smtp.Send(Msg); ////////////// Redirects to Error page. I don't know what is wrong
error.ForeColor = Color.Green; //Msg = null; error.Text = "Your Password Details Sent to your mail"; // Clear the textbox valuess Temail.Text = ""; } else { error.ForeColor = Color.Red; error.Text = "The Email you entered not exists."; }
smtp asp.net c#
All-Star
120146 Points
27989 Posts
Moderator
MVP
Aug 04, 2014 10:15 AM|ignatandrei|LINK
and what is not working, precisely?
Member
381 Points
209 Posts
Aug 06, 2014 06:06 AM|velambath|LINK
Hi,
Put your error code : smtp.Send(Msg); inside TRY Block and see the error catches .
Let us know if you get more trouble still
Rigin
None
0 Points
1 Post
SmtpClient.Send(Msg) not working in somee.com
Aug 04, 2014 09:07 AM|vikasparmar88|LINK
if (ds.Tables[0].Rows.Count > 0)
{
MailMessage Msg = new MailMessage();
// Sender e-mail address.
Msg.From = new MailAddress("vikasparmar88@gmail.com");
// Recipient e-mail address.
Msg.To.Add(Temail.Text);
Msg.Subject = "Check Password";
Msg.Body = "Hi, <br/>Please check your Login Detailss<br/><br/>Your Username: " + ds.Tables[0].Rows[0]["Name"] + "<br/><br/>Your Password: " + ds.Tables[0].Rows[0]["Password"] + "<br/><br/>";
Msg.IsBodyHtml = true;
// your remote SMTP server IP.
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.Credentials = new System.Net.NetworkCredential("vikasparmar88@gmail.com", "vijaydas@1991");
smtp.EnableSsl = true;
smtp.Send(Msg); ////////////// Redirects to Error page. I don't know what is wrong
error.ForeColor = Color.Green;
//Msg = null;
error.Text = "Your Password Details Sent to your mail";
// Clear the textbox valuess
Temail.Text = "";
}
else
{
error.ForeColor = Color.Red;
error.Text = "The Email you entered not exists.";
}
smtp asp.net c#
All-Star
120146 Points
27989 Posts
Moderator
MVP
Re: SmtpClient.Send(Msg) not working in somee.com
Aug 04, 2014 10:15 AM|ignatandrei|LINK
and what is not working, precisely?
smtp asp.net c#
Member
381 Points
209 Posts
Re: SmtpClient.Send(Msg) not working in somee.com
Aug 06, 2014 06:06 AM|velambath|LINK
Hi,
Put your error code : smtp.Send(Msg); inside TRY Block and see the error catches .
Let us know if you get more trouble still
Rigin
smtp asp.net c#
- Rigin