mail attachment problem(mail box unavailable,The server response was: 5.7.1 Unable to relay)
-
Dim SendFrom As MailAddress = New MailAddress(txtFrom.Text) Dim SendTo As MailAddress = New MailAddress(txtTo.Text) Dim MyMessage As MailMessage = New MailMessage(SendFrom, SendTo) MyMessage.Subject = txtSubject.Text MyMessage.Body = txtBody.Text Dim attachFile As New Attachment(txtAttachmentPath.Text) MyMessage.Attachments.Add(attachFile) Dim emailClient As New SmtpClient(txtSMTPServer.Text) emailClient.Send(MyMessage) above is my code, while i run this am getting the below error "mail box unavailable,The server response was: 5.7.1 Unable to relay for murali.sg@gmail.com" is there any solutions..?
self confidence+hard work=SUCCESS
-
Dim SendFrom As MailAddress = New MailAddress(txtFrom.Text) Dim SendTo As MailAddress = New MailAddress(txtTo.Text) Dim MyMessage As MailMessage = New MailMessage(SendFrom, SendTo) MyMessage.Subject = txtSubject.Text MyMessage.Body = txtBody.Text Dim attachFile As New Attachment(txtAttachmentPath.Text) MyMessage.Attachments.Add(attachFile) Dim emailClient As New SmtpClient(txtSMTPServer.Text) emailClient.Send(MyMessage) above is my code, while i run this am getting the below error "mail box unavailable,The server response was: 5.7.1 Unable to relay for murali.sg@gmail.com" is there any solutions..?
self confidence+hard work=SUCCESS
-
Dim SendFrom As MailAddress = New MailAddress(txtFrom.Text) Dim SendTo As MailAddress = New MailAddress(txtTo.Text) Dim MyMessage As MailMessage = New MailMessage(SendFrom, SendTo) MyMessage.Subject = txtSubject.Text MyMessage.Body = txtBody.Text Dim attachFile As New Attachment(txtAttachmentPath.Text) MyMessage.Attachments.Add(attachFile) Dim emailClient As New SmtpClient(txtSMTPServer.Text) emailClient.Send(MyMessage) above is my code, while i run this am getting the below error "mail box unavailable,The server response was: 5.7.1 Unable to relay for murali.sg@gmail.com" is there any solutions..?
self confidence+hard work=SUCCESS
MS Lee wrote:
above is my code, while i run this am getting the below error "mail box unavailable,The server response was: 5.7.1 Unable to relay for murali.sg@gmail.com"
Error Clearly say's that The mailbox does not exist. Does that mailbox (mailid) exist?
cheers, Abhijit My Recent Article : Beginner's Guide to ASP.NET Application Folder
-
MS Lee wrote:
above is my code, while i run this am getting the below error "mail box unavailable,The server response was: 5.7.1 Unable to relay for murali.sg@gmail.com"
Error Clearly say's that The mailbox does not exist. Does that mailbox (mailid) exist?
cheers, Abhijit My Recent Article : Beginner's Guide to ASP.NET Application Folder
-
Mail id is exists.but it shows the error at mail server(mail box unavailable)
self confidence+hard work=SUCCESS
Does your SMPT Server configure properly ?
cheers, Abhijit My Recent Article : Beginner's Guide to ASP.NET Application Folder
-
Dim SendFrom As MailAddress = New MailAddress(txtFrom.Text) Dim SendTo As MailAddress = New MailAddress(txtTo.Text) Dim MyMessage As MailMessage = New MailMessage(SendFrom, SendTo) MyMessage.Subject = txtSubject.Text MyMessage.Body = txtBody.Text Dim attachFile As New Attachment(txtAttachmentPath.Text) MyMessage.Attachments.Add(attachFile) Dim emailClient As New SmtpClient(txtSMTPServer.Text) emailClient.Send(MyMessage) above is my code, while i run this am getting the below error "mail box unavailable,The server response was: 5.7.1 Unable to relay for murali.sg@gmail.com" is there any solutions..?
self confidence+hard work=SUCCESS
I assume you're attempting to relay through your own GMail account here......that'll never work...Gmail / Hotmail / Yahoo and most of the free ones don't permit relaying (to stop spammers)... You'll need to change the SMTP details (SMTPServer etc) to one that permits relaying.
C# has already designed away most of the tedium of C++.