I'm trying to send email from my web site using SMTP:
Dim iMsg As MailMessage
iMsg = New MailMessage
Dim addrs(1) As MailAddress
addrs(0) = New MailAddress(towhom)
addrs(1) = New MailAddress(fromwho)
iMsg.From = New MailAddress(fromwho)
iMsg.To.Add(addrs(0))
iMsg.Bcc.Add(addrs(1))
iMsg.Subject = subj
iMsg.Body = textbody
'----------------------------------------------------
Dim ret As String = String.Empty
Try
' set up smtp client And credentials
Dim smtpClnt As New SmtpClient("relay-Hosting.secureserver.net")
smtpClnt.UseDefaultCredentials = True
smtpClnt.Port = 25
' send the message
smtpClnt.Send(iMsg)
'inform user that message has sent
ret = "Email was sent to: " & towhom & " with subject: " & subj
Catch ex As Exception
ret = ex.Message
End Try
Return ret
It returns that Email was sent, but I did not get it.
What I'm doing wrong?
Hey @yanbor,
Not sure what language you're using to script your form mailer, but as long as you have 'relay-hosting@secureserver.net' specified as the relay server via port 25, then SMTP should be sending. Our hosting teams have confirmed this still works via test SMTP and PHP mail scripting resources.
This is a function in ASP.NET code behind. It gave me notice, that email is sent, but it never did come to the user. And I check all folders: All Mail, Spam, etc...