My Visual Basic 2010 application needs to send a text message to three phones under certain conditions.
Written and tested on a Win7 machine it works fine.
After installing on the production machine, a Win Server 2003, the following error occurs:
"5 Mailbox unavailable. The server response was: 5.7.1 <3175551212@messaging.sprintpcs.com>... Relaying denied in sbSendEmail" (number in address changed for security purposes)
Same error occurs when sending to a Verizon account.
If I substitute a standard email address, i.e. email@company.com the email goes through.
My "systems guy" assures me that there is nothing in the firewall that would block one email and not another. Could there be a OS setting that is affecting this?
Here is the block of code used to send the email:
Written and tested on a Win7 machine it works fine.
After installing on the production machine, a Win Server 2003, the following error occurs:
"5 Mailbox unavailable. The server response was: 5.7.1 <3175551212@messaging.sprintpcs.com>... Relaying denied in sbSendEmail" (number in address changed for security purposes)
Same error occurs when sending to a Verizon account.
If I substitute a standard email address, i.e. email@company.com the email goes through.
My "systems guy" assures me that there is nothing in the firewall that would block one email and not another. Could there be a OS setting that is affecting this?
Here is the block of code used to send the email:
Code:
Imports System.Net.Mail
Imports System.Net
Private Sub sbSendEmail(ByVal msgText As String)
Dim ErrMsg As String = ""
Dim fEmail As Integer
Dim strAddTemp As String = ""
On Error GoTo sbsendemail_errortrap
fEmail = FreeFile()
FileOpen(fEmail, Application.StartupPath & "\emailaddresses.txt", OpenMode.Input)
Dim smtpServer As New SmtpClient("mail.company.com")
Dim mail As New MailMessage
mail.From = New MailAddress("name@company.com")
Do Until EOF(fEmail)
Input(fEmail, strAddTemp)
mail.To.Add(strAddTemp)
Loop
FileClose(fEmail)
mail.Subject = "IMS db Problem"
mail.Body = msgText
mail.Priority = MailPriority.High
smtpServer.Port = 25
smtpServer.EnableSsl = False
smtpServer.Credentials = New NetworkCredential("name@company.com", "password")
smtpServer.Send(mail)
sbLogEntry("Email Sent", msgText)
On Error GoTo 0
Exit Sub
sbsendemail_errortrap:
ErrMsg = Err.Number & " " & Err.Description & " in sbSendEmail"
sbLogEntry(ErrMsg, "")
Resume Next
End Sub