AlanDI1
Programmer
- Apr 20, 2003
- 56
I have an Access VBA process that reads a table and creates a bunch of e-mails. Fairly straight forward.
*****************************************************
Dim objOutlook As New Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
On Error GoTo ErrorMsgs
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = "test@test.net"
' Set the Subject, Bodyof the message.
.Subject = "Test ID"
.Body = "Here is your New ID and Password" & vbCrLf
.Send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
**********************************************************
I do not want the "from" in the e-mail that is received by the recipient to have my e-mail address but that of the system administrator.
1 - is it possible to hard code a "from" e-mail address when generating the message? The "SentOnBehalfOfName" shows both my e-mail address and the system administrator, that's not good. The "SenderEmailAddress" seems to be read only.
2 - if #1 is not possible, I can create a second account on the machine that will run this process but how do I tell the process creating the e-mail which account to use?
Thanks
*****************************************************
Dim objOutlook As New Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
On Error GoTo ErrorMsgs
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
.To = "test@test.net"
' Set the Subject, Bodyof the message.
.Subject = "Test ID"
.Body = "Here is your New ID and Password" & vbCrLf
.Send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
**********************************************************
I do not want the "from" in the e-mail that is received by the recipient to have my e-mail address but that of the system administrator.
1 - is it possible to hard code a "from" e-mail address when generating the message? The "SentOnBehalfOfName" shows both my e-mail address and the system administrator, that's not good. The "SenderEmailAddress" seems to be read only.
2 - if #1 is not possible, I can create a second account on the machine that will run this process but how do I tell the process creating the e-mail which account to use?
Thanks