Click here to Skip to main content
15,887,451 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

I am working on smtp forgot password
sample code:
Email.text="hdsjd@gmail.com"
string s="body message";
smtp.host="mail.mydomain.com"
smtp port=25;
smtp.Send(Email.Text, "info@mydomain.com", "Enquiry Details", s);

but I didn't get mail. What did I do wrong?

Please help me.
Posted
Updated 16-Feb-11 19:10pm
v2
Comments
JF2015 17-Feb-11 1:10am    
Added code formatting.

It can be because of various reasons. You need to look at them one by one.
Is the port open? Firewall permissions in place?
Further make sure you have configured SMTP configuration properly.
 
Share this answer
 
Hope this[^] might help you.
 
Share this answer
 
use this
using System.Net.Mail;


MailMessage mail = new MailMessage();
mail.To.Add(TextBox1.Text);

mail.From = new MailAddress("your user name");
mail.Subject = TextBox2.Text;

string Body = FCKeditor1.Value.ToString();
mail.Body = Body;

mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("your user_name", "your password");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900