Hi all,
howz life there
well I have developed a mail program ( ASP.NET / C# ) for my site which sends user passwords to their email
addresses. However the problem is that my mails are not received in Inbox whereas they are
diverted
to the Spam folder. I am not able to resolve it niether I think there
is any issue with code as its quite straight forward.
Here is the code have a look if you could suggest any changes or hints that woul be quite helpful
/************ The CODE ********************************/
using dataclass; // mydatabase class
using System.Net.Mail;
using System.SMTP;
using System.Text;
string to;
string sub;
string msg;
Stringbuilder strbld=new Stringbuilder();
to=sqlreader['email']; // email address is retrived from database
sub="Your Login Information";
strbld.Append("Hello" + sqlreader['username'] + "<br>"); // username from database
strbld.Append("Your login name is :" + sqlreader['userlogin'] + "<br>"); // login id from database
strbld.Append("Your login password is :" + sqlreader['userpassword'] + "<br>"); // password from database
strbld.Append("Thank You <br>");
strbld.Append("<br><br>");
strbld.Append("Support Team <br>");
strbld.Append("Mysite.com <br>");
msg=strbld.ToString();
MailMessage mlmsg = new MailMessage();
mlmsg.body=msg;
mlmsg.To.Add(new MailAddress(to));
mlmsg.From=new MailAddress("support@mysite.com","Support Team");
mlmsg.Subject=sub;
mlmsg.IsBodyHtml=true;
SmtpClient mailit = new SmtpClient("Myserver");
mailit.Port=25;
mailit.timeout=200;
mailit.Send(mlmsg);
/**************end of code **********************************/
Thanks in advance.
pIrus
I4INDIAN
Dreams in our eye, Goals are high
Sky is not the limit, when we spread wings and fly
www.Marketraise.com
pIrus
Dreams in our eyes, We are aiming high
Sky is not the limit, When we spread wings and fly
Marketraise.com