sending Email
-
hi all, I am learning to send an email frm my website using system.net.mail. The mail is sent and there is no error but the recipient doesn't recieve the mail but it is shown in Inetpub\mailroot\queue and after sometime delivery is failed. Plz help me.Where I am wrong ?? Any specific setting for this?? //variables string strFromEmail = tbxFrom.Text; string strToEmail = tbxTo.Text; string strSubject = tbxSubject.Text; string strMsg = ftbMsg.Text; string strHostName = "mail.gmail.com"; int iHostSMTPPort=25; //string strImagePath; //variable to create message instace MailAddress mailAddrFrom = new MailAddress(strFromEmail); MailAddress mailAddrTo = new MailAddress(strToEmail); MailMessage msgObj = new MailMessage(mailAddrFrom,mailAddrTo); //definitions to send mail SmtpClient smtpObj = new SmtpClient(strHostName, iHostSMTPPort); //settings to send email msgObj.Subject = strSubject; msgObj.Body = strMsg; msgObj.IsBodyHtml = true; smtpObj.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis; //sending email smtpObj.Send(msgObj);
-
hi all, I am learning to send an email frm my website using system.net.mail. The mail is sent and there is no error but the recipient doesn't recieve the mail but it is shown in Inetpub\mailroot\queue and after sometime delivery is failed. Plz help me.Where I am wrong ?? Any specific setting for this?? //variables string strFromEmail = tbxFrom.Text; string strToEmail = tbxTo.Text; string strSubject = tbxSubject.Text; string strMsg = ftbMsg.Text; string strHostName = "mail.gmail.com"; int iHostSMTPPort=25; //string strImagePath; //variable to create message instace MailAddress mailAddrFrom = new MailAddress(strFromEmail); MailAddress mailAddrTo = new MailAddress(strToEmail); MailMessage msgObj = new MailMessage(mailAddrFrom,mailAddrTo); //definitions to send mail SmtpClient smtpObj = new SmtpClient(strHostName, iHostSMTPPort); //settings to send email msgObj.Subject = strSubject; msgObj.Body = strMsg; msgObj.IsBodyHtml = true; smtpObj.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis; //sending email smtpObj.Send(msgObj);
Does your SMTP server Configure properly?
cheers, Abhijit Read My Latest Article
-
Does your SMTP server Configure properly?
cheers, Abhijit Read My Latest Article
I don't know. It works fine when I send email from my gmail account.but fails when I use any other domaim.I use server smtp.gmail.com Thanks for ur response.
-
hi all, I am learning to send an email frm my website using system.net.mail. The mail is sent and there is no error but the recipient doesn't recieve the mail but it is shown in Inetpub\mailroot\queue and after sometime delivery is failed. Plz help me.Where I am wrong ?? Any specific setting for this?? //variables string strFromEmail = tbxFrom.Text; string strToEmail = tbxTo.Text; string strSubject = tbxSubject.Text; string strMsg = ftbMsg.Text; string strHostName = "mail.gmail.com"; int iHostSMTPPort=25; //string strImagePath; //variable to create message instace MailAddress mailAddrFrom = new MailAddress(strFromEmail); MailAddress mailAddrTo = new MailAddress(strToEmail); MailMessage msgObj = new MailMessage(mailAddrFrom,mailAddrTo); //definitions to send mail SmtpClient smtpObj = new SmtpClient(strHostName, iHostSMTPPort); //settings to send email msgObj.Subject = strSubject; msgObj.Body = strMsg; msgObj.IsBodyHtml = true; smtpObj.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis; //sending email smtpObj.Send(msgObj);
joindotnet wrote:
Inetpub\mailroot\queue
Your SMTP server might be stopped. Type
inetmgr
in the "Run" window, Click on "Default SMTP server" and start it.Navaneeth How to use google | Ask smart questions
-
joindotnet wrote:
Inetpub\mailroot\queue
Your SMTP server might be stopped. Type
inetmgr
in the "Run" window, Click on "Default SMTP server" and start it.Navaneeth How to use google | Ask smart questions
It is not stopped.I have checked it.I can send emails from gmail to gmail if I use smtp.gmail.com host server. How can I send mail from any domain to any domain. Plz help.I'd be obliged.
-
I don't know. It works fine when I send email from my gmail account.but fails when I use any other domaim.I use server smtp.gmail.com Thanks for ur response.
You can not use smtp.gmail.com you have to use mail.yourdomainname.com. and if you are sending from local system then use localhost or 127.0.0.1 I hope it will help you. http://techiefromsurat.blogspot.com