Code: Select all
Shared Function SendEmail(ByVal mail_to As String, ByVal mail_toname As String, ByVal mail_from As String, ByVal mail_fromname As String, ByVal mail_subject As String, ByVal mail_body As String, ByVal is_html As Boolean, ByVal invoice_pdf_stream As System.IO.Stream, ByVal invoiceid As Integer) As Boolean
Try
Dim message As New MailMessage()
message.To.Add(New MailAddress(mail_to, mail_toname))
message.From = New MailAddress(mail_from, mail_fromname)
message.Subject = mail_subject
message.Body = mail_body
message.IsBodyHtml = is_html
Dim client As New SmtpClient()
client.Host = mailenableserver
client.Credentials = New System.Net.NetworkCredential(login), password)
client.Port = 465 'Does not work unless set to 25
client.EnableSsl = True
client.Send(message)
Return True
Catch
Return False
End Try
End Function
And I of course have Listen on alternate ports enabled with auth mode of always allow enabled. Any ideas?