Hi I am trying to automatically send an email from one of my pages. This is the code I am using:
The weird thing is that it worked for a couple months just fine, but now it works sometimes just fine, but other times I get a failed to connect to transport error. I was wondering what would be causing it to work so erratically, and since I have access to the server is there a command that I can type into the command prompt to find the SMTP address rather than using "CarletonInc.local"?
Code:
objMailMessage = New MailMessage
objMailMessage.From = ViewState("Email").Trim()
objMailMessage.To= EReader("Email").Trim()
objMailMessage.Subject= "CONTRACT OFFER"
objMailMessage.Body = "Congratulations " & Ereader("FirstName") & " " & EReader("LastName") & "! " & vbcrlf & "You have been offered a contract by " & ViewState("GM") & " of the " & ViewState("TeamName") & ". "
If Goods.Text.Trim() <> "" Then
objMailMessage.Body &= "They have also offered: " & Goods.Text & " If you sign with their team. "
End If
objMailMessage.Body &= "The Turkey Bowl Administration would like to wish you the best in your decision click the link below, and sign in, to either sign with this team or decline the offer." & vbcrlf & "[URL unfurl="true"]http://www.carletonasptest.com/websitestatesearch/TConfirm.aspx"[/URL]
SmtpMail.SmtpServer = "CarletonInc.local"
SmtpMail.Send( objMailMessage )
The weird thing is that it worked for a couple months just fine, but now it works sometimes just fine, but other times I get a failed to connect to transport error. I was wondering what would be causing it to work so erratically, and since I have access to the server is there a command that I can type into the command prompt to find the SMTP address rather than using "CarletonInc.local"?