I was successful at one point sending mail internally using exchange server. Here is the code I used.....
This worked perfectly for internal but not for external. The office is using Godaddy mail for their email. I don't even know if this is even possible but here is my attempt......which isn't working.
You may laugh when you see what I've done here because I am not a pro by any means and I am a real beginner. So, if there is something that doesn't look right it's because I don't know any better.
Here is the error message I keep getting:
SmtpFailedRecipientException
Mailbox name not allowed. The server response was: Sorry, that domain isn't in my list of allowed rcpthosts.
Any help would be greatly appreciated. Thanks.
VB.NET:
Dim message1 As New System.Net.Mail.MailMessage()
message1.To.Add(tech)
message1.Subject = tasknumber
message1.From = New System.Net.Mail.MailAddress("email@server.org")
message1.Body = issue
Dim smtp As New System.Net.Mail.SmtpClient("XXX.XX.XX.X")
smtp.Send(message1)
This worked perfectly for internal but not for external. The office is using Godaddy mail for their email. I don't even know if this is even possible but here is my attempt......which isn't working.
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tech As String
Dim tech1 As String
tech1 = txtemailto1.Text
tech = tech1
Dim message1 As New System.Net.Mail.MailMessage()
message1.To.Add(tech)
message1.Subject = (RequestIDTextBox.Text)
message1.From = New System.Net.Mail.MailAddress("email@server.com")
message1.Body = IssueTextBox.Text
Dim smtpout As String
smtpout = "smtpout.secureserver.net"
Dim smtpport As Integer
smtpport = 25
Dim userName As String
userName = "johndoe"
Dim password As String
password = "password"
Dim smtpauth As New System.Net.NetworkCredential(userName, password)
Dim smtp As New System.Net.Mail.SmtpClient(smtpout, smtpport)
smtp.Send(message1)
End Sub
You may laugh when you see what I've done here because I am not a pro by any means and I am a real beginner. So, if there is something that doesn't look right it's because I don't know any better.
Here is the error message I keep getting:
SmtpFailedRecipientException
Mailbox name not allowed. The server response was: Sorry, that domain isn't in my list of allowed rcpthosts.
Any help would be greatly appreciated. Thanks.