jackie77
Jackie
- Local time
- Today, 20:58
- Joined
- Jul 18, 2007
- Messages
- 85
Hi all 
I found a great email example on the web written by blue claw database designs see code below and (I have also attched the file for others to use)what I am looking to do is to get it to send using the out going email address I specify, I have two email address running out of outlook and one is just a sending accounts how do I specify which one to use?
Thanks
Jackie
I found a great email example on the web written by blue claw database designs see code below and (I have also attched the file for others to use)what I am looking to do is to get it to send using the out going email address I specify, I have two email address running out of outlook and one is just a sending accounts how do I specify which one to use?
Code:
Option Compare Database
Private Sub Command20_Click()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = Me.Email_Address
.Subject = Me.Mess_Subject
.HTMLBody = Me.Mess_Text
If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
.Attachments.Add (Me.Mail_Attachment_Path)
End If
'.DeleteAfterSubmit = True 'This would let Outlook send th note without storing it in your sent bin
.Send
End With
'MsgBox MailOutLook.Body
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
Resume Error_out
Error_out:
End Sub
Thanks
Jackie