for some reason for this simple function I created, the portion smtp.Send(message) is throwing an error;
I get the error "Failure Sending Mail". I don't get anything much other than that in the error message...unles there's another place I should be looking.
This is ASP.NET 2.0 code using the System.Net.mail namespace:
Private Function SendEmail(ByVal exception_msg As String, ByVal place As String)
Dim message As New System.Net.Mail.MailMessage("email@example.com", "firstname.lastname@example.org")
message.Subject = "Exception"
message.Body = "Error happened in this area" & place & "Error information: " & exception_msg
Dim smtp As New System.Net.Mail.SmtpClient("Exchange servername")
smtp.Send(message) <-------------- Error happens here
The servername I'm puting in there is one I've used on other servers as an smtp client. I'm not sure if this just can't talk to external servers or not or just that I have a syntax problem.