Hi all:
I'm using a procedure provided by Microsoft that appears to work, but it doesn't send anything.
This is a slightly modified MS sub; I added port and type sent.
Am I missing something?
Thanks,
Ron Repp
If gray hair is a sign of wisdom, then I'm a genius.
My newest novel: Wooden Warriors
I'm using a procedure provided by Microsoft that appears to work, but it doesn't send anything.
This is a slightly modified MS sub; I added port and type sent.
Code:
Public Sub SendMailMessage(ByVal from As String, ByVal recepient As String, ByVal bcc As String, ByVal cc As String, _
ByVal subject As String, ByVal body As String)
' Instantiate a new instance of MailMessage
Dim mMailMessage As New MailMessage()
' Set the sender address of the mail message
mMailMessage.From = New MailAddress(from)
' Set the recepient address of the mail message
mMailMessage.To.Add(New MailAddress(recepient))
' Check if the bcc value is null or an empty string
If Not bcc Is Nothing And bcc <> String.Empty Then
' Set the Bcc address of the mail message
mMailMessage.Bcc.Add(New MailAddress(bcc))
End If
' Check if the cc value is null or an empty value
If Not cc Is Nothing And cc <> String.Empty Then
' Set the CC address of the mail message
mMailMessage.CC.Add(New MailAddress(cc))
End If
' Set the subject of the mail message
mMailMessage.Subject = subject
' Set the body of the mail message
mMailMessage.Body = body
' Secify the format of the body as HTML
mMailMessage.IsBodyHtml = True
' Set the priority of the mail message to normal
mMailMessage.Priority = MailPriority.Normal
' Instantiate a new instance of SmtpClient
Dim mSmtpClient As New SmtpClient()
''I added this
[b]mSmtpClient.Host = "RepProductions"
mSmtpClient.Port = 995
mSmtpClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis[/b]
''to here
' Send the mail message
mSmtpClient.Send(mMailMessage)
MessageBox.Show("Sent")
End Sub
Am I missing something?
Thanks,
Ron Repp
If gray hair is a sign of wisdom, then I'm a genius.
My newest novel: Wooden Warriors