t1hodges
MIS
- May 8, 2003
- 54
hello, plee for help.
im writing code to send and email message to one recipient but it sends two in error. here's my code below.
Imports System
Imports System.Data.SqlClient
Imports System.Data.Odbc
Imports System.Net.Mail
Imports System.Reflection
Imports System.Data.OleDb
Private Sub SendEMail(ByVal x, ByVal y, ByVal z)
'x strEmailSubject
'y strRecipients
'z strEmailBody
Dim a As Microsoft.Office.Interop.Outlook.Application
a = CreateObject("Outlook.Application")
Dim b As Microsoft.Office.Interop.Outlook.NameSpace
b = a.GetNamespace("MAPI")
b.Logon()
Dim c, d As Object
Dim f As Microsoft.Office.Interop.Outlook.MailItem
f = a.CreateItem(d)
f.To = "myemailaddress@mydomain.com"
f.Subject = x
f.Body = z
f.Send()
b.Logoff()
b = Nothing
f = Nothing
c = Nothing
a = Nothing
End Sub
im writing code to send and email message to one recipient but it sends two in error. here's my code below.
Imports System
Imports System.Data.SqlClient
Imports System.Data.Odbc
Imports System.Net.Mail
Imports System.Reflection
Imports System.Data.OleDb
Private Sub SendEMail(ByVal x, ByVal y, ByVal z)
'x strEmailSubject
'y strRecipients
'z strEmailBody
Dim a As Microsoft.Office.Interop.Outlook.Application
a = CreateObject("Outlook.Application")
Dim b As Microsoft.Office.Interop.Outlook.NameSpace
b = a.GetNamespace("MAPI")
b.Logon()
Dim c, d As Object
Dim f As Microsoft.Office.Interop.Outlook.MailItem
f = a.CreateItem(d)
f.To = "myemailaddress@mydomain.com"
f.Subject = x
f.Body = z
f.Send()
b.Logoff()
b = Nothing
f = Nothing
c = Nothing
a = Nothing
End Sub