VB.NET 2003 Email

I developed an application in VB.NET 2002 that sends email. Because of problems with Microsoft updates and hot fixes I had to move the code to VB.NET 2003. The Email code from 2002 I was using no longer works. The enclosed code will work on a default Email setup, but I cant change the TCI/IP Port setting, Enter a UserID and Password, or authorization if required. I dont want to use a local SMTP Server or smart server setup because my customers dont all have operating systems that support IIS. Anyone have any ideas?
Thanks,
Linda

Imports System.Windows.Forms.ComboBox.ObjectCollection
Imports System.Array
Imports System.Windows.Forms.TextBox
Imports System.Web.Mail
Imports System.Text
Imports System.ServiceProcess

Dim mailMsg As New MailMessage
With mailMsg
.From = sEmailAddressFrom
.To = sEmailAddressTo
.BCC = strBCC
.Subject = txtSubject.Text.Trim
.Body = rtxtEmailText.Text
.Priority = 3
End With

SmtpMail.SmtpServer = sEmailAddressServer

Try
SmtpMail.Send(mailMsg)
mailMsg = Nothing

MessageBox.Show("Your email has been successfully sent!", _
"Email Send Status", MessageBoxButtons.OK, _
MessageBoxIcon.Information)

Catch exp As Exception
MessageBox.Show("The following problem occurred when attempting to " & _
"send your email: " & exp.Message, _
Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories