Problem in sending e-mail through code in asp.net2.0 ?
-
Hi, When i try to send email using the following code : MailMessage objEmail = new MailMessage(); objEmail.To = "feedback@yendha.com"; objEmail.From = "subinalex007@gmail.com"; objEmail.Subject = "Feed Back to www.yendha.com"; objEmail.Body = txt_feed.Text; try { SmtpMail.SmtpServer = "smtp.yendha.com"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully to "); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } An Exception is raised i.e, "The server rejected one or more recipient addresses. The server response was: 554 5.7.1 subinalex007@gmail.com: Sender address rejected: Access denied\r\n"
-
Hi, When i try to send email using the following code : MailMessage objEmail = new MailMessage(); objEmail.To = "feedback@yendha.com"; objEmail.From = "subinalex007@gmail.com"; objEmail.Subject = "Feed Back to www.yendha.com"; objEmail.Body = txt_feed.Text; try { SmtpMail.SmtpServer = "smtp.yendha.com"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully to "); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } An Exception is raised i.e, "The server rejected one or more recipient addresses. The server response was: 554 5.7.1 subinalex007@gmail.com: Sender address rejected: Access denied\r\n"
Subin Alex wrote:
The server rejected one or more recipient addresses. The server response was: 554 5.7.1 : Sender address rejected: Access denied\r\n"
The SMTP Security policies are not allowing you to use gmail address for sending the mail.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Hi, When i try to send email using the following code : MailMessage objEmail = new MailMessage(); objEmail.To = "feedback@yendha.com"; objEmail.From = "subinalex007@gmail.com"; objEmail.Subject = "Feed Back to www.yendha.com"; objEmail.Body = txt_feed.Text; try { SmtpMail.SmtpServer = "smtp.yendha.com"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully to "); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } An Exception is raised i.e, "The server rejected one or more recipient addresses. The server response was: 554 5.7.1 subinalex007@gmail.com: Sender address rejected: Access denied\r\n"
Try This class to send mail. System.Net.Mail.SmtpClient() Regards, SG
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
-
Hi, When i try to send email using the following code : MailMessage objEmail = new MailMessage(); objEmail.To = "feedback@yendha.com"; objEmail.From = "subinalex007@gmail.com"; objEmail.Subject = "Feed Back to www.yendha.com"; objEmail.Body = txt_feed.Text; try { SmtpMail.SmtpServer = "smtp.yendha.com"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully to "); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } An Exception is raised i.e, "The server rejected one or more recipient addresses. The server response was: 554 5.7.1 subinalex007@gmail.com: Sender address rejected: Access denied\r\n"
MAny SMTP servers restrict the sender to a local domain. That means if the SMTP Server is expecting all senders to be from 'somedomain.com' for example. Using your gmail address as the From address will cause the server to refuse to send mail.
-
Try This class to send mail. System.Net.Mail.SmtpClient() Regards, SG
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
Hi, I tried it, but it returned the err "Sending Failure" Plz help.
-
MAny SMTP servers restrict the sender to a local domain. That means if the SMTP Server is expecting all senders to be from 'somedomain.com' for example. Using your gmail address as the From address will cause the server to refuse to send mail.
Hi, It is not a local domain , but Remote
-
Hi, I tried it, but it returned the err "Sending Failure" Plz help.
Hi Subin, This Should Work.If Not Your Mail server is blocking somewhere. Dim mSmtpClient As New System.Net.Mail.SmtpClient() mSmtpClient.Host = "You Mail server name" //smtp.yendha.com mSmtpClient.Port = "Port Being used Of your mail server" mSmtpClient.Send(oMailMsg)
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.