Error while sending mail
-
Hi to All, I am trying to send email using the following code Dim MMsg as MailMessage = New MailMessage(FromEmailID, ToEmailID, Subject, BodyMessage) MMsg.Priority = MailPriority.High Dim smtp As SmtpClient = New SmtpClient(SMTP.MyServer.com, PortNumber) smtp.Send(MMsg) While sending mail to xyz@MyServer.com it works fine but whenever I am sending mail to xyz@Otherserver.com (eg. Gmail, yahoo) then it gives following error. ================================================================================== Mailbox name not allowed. The server response was: sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) ================================================================================== Somebody help me. Thanking you. Regards,
Pravin
-
Hi to All, I am trying to send email using the following code Dim MMsg as MailMessage = New MailMessage(FromEmailID, ToEmailID, Subject, BodyMessage) MMsg.Priority = MailPriority.High Dim smtp As SmtpClient = New SmtpClient(SMTP.MyServer.com, PortNumber) smtp.Send(MMsg) While sending mail to xyz@MyServer.com it works fine but whenever I am sending mail to xyz@Otherserver.com (eg. Gmail, yahoo) then it gives following error. ================================================================================== Mailbox name not allowed. The server response was: sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) ================================================================================== Somebody help me. Thanking you. Regards,
Pravin
Check this out: SOlutions!