Last post Dec 05, 2017 03:11 AM by Eric Du
Dec 04, 2017 12:02 PM|alihusain_77|LINK
I am trying to send email dynamically using the IIS from email. I got the following error:
I have the following code:
Public Sub SendAccountApprovalEmail()
Dim MyMailSubject As String
Dim MyMailBody As String
Dim MyRecipientMail As String
Dim MyMailMessage As New MailMessage
Dim MySmtpClient As New System.Net.Mail.SmtpClient
MyMailSubject = "New Murasalat Account"
MyMailBody = "Dear User...Successfully new username created for you"
MyMailBody = MyMailBody & Trim(UserNameTxtBox.Text) & "UserName"
MyMailBody = MyMailBody & Trim(PassCodeTxtBox.Text) & " Password"
If IsTopOfficeUserName = 1 Then
MyMailBody = MyMailBody & "You can Start Immediately"
MyMailBody = MyMailBody & "After Getting the Authorization"
IsTopOfficeUserName = 0
MyRecipientMail = Trim(EmailTxtBox.Text)
MyRecipientMail = "email@example.com"
MySmtpClient.Port = 25
MySmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network
MySmtpClient.Credentials = New System.Net.NetworkCredential("murasalat", "Trackingdesk10")
MySmtpClient.Host = "10.30.32.45"
MyMailMessage.Subject = MyMailSubject
MyMailMessage.Body = MyMailBody
WHY IS THIS ERROR GENERATED?
Dec 04, 2017 02:29 PM|PatriceSc|LINK
AFAIK it's quite common that a mail server handling a sample.com domain is configured to accept only @sample.com for the "from" address.. Make sure the sender mail address matches the domain handled by your STMP server.
Dec 04, 2017 02:32 PM|mgebhard|LINK
Perhaps you need a relay service?
Dec 04, 2017 09:15 PM|alihusain_77|LINK
Would you please give me more details. The exchange server is the host that set using the statement: smtpclient.host="10.31.15.4" for example. Thus, what do you mean by you remark?
Dec 05, 2017 03:11 AM|Eric Du|LINK
According to your description and code, i can not found some conspicuous error in your code, so i suggest you could troubleshot problem through sending email. For more details, please check this tutorial:
Troubleshooting Problems Sending Emails:
Also here are someone who meet the similar issue as you, please check:
Mail Failed -Mailbox unavailable -Server response : 5.7.60 SMTP: