W
wazzas
Guest
Dear all
Ive just lost my workbook i used to automate multiple email msgs to my customers.
I urgently need a replacement. I hava a few requirements but I cant seem to model the stuff together..
1: My list of email addresss are in excel
2: Im using outlook express
4: I wish to specify the 'from' address (my email address) ****
3: Im sending html email with graphics ****
This is what ive come up with below, but cant get it working and dont know how to specify my email account to send from! PLS PLS Help asap.
Kind Regards
- - - - - - -
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
- - - - - - - - - - - - - - -
Sub SendEMail()
Dim Email As String, subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
For r = 2 To 4 'data in rows 2-4
' Get the email address
Email = Cells(r, 2)
' Message subject
subj = "Testing email"
' Compose the message
Msg = ""
Msg = """This is <I>HTML / MIME</I> e-mail message sent from MS EXCEL VB script<BR>"
' Replace spaces with %20 (hex)
subj = Application.WorksheetFunction.Substitute(subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & subj & "&body=" & Msg
' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
' Wait two seconds before sending keystrokes
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
Next r
End Sub
Ive just lost my workbook i used to automate multiple email msgs to my customers.
I urgently need a replacement. I hava a few requirements but I cant seem to model the stuff together..
1: My list of email addresss are in excel
2: Im using outlook express
4: I wish to specify the 'from' address (my email address) ****
3: Im sending html email with graphics ****
This is what ive come up with below, but cant get it working and dont know how to specify my email account to send from! PLS PLS Help asap.
Kind Regards
- - - - - - -
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
- - - - - - - - - - - - - - -
Sub SendEMail()
Dim Email As String, subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
For r = 2 To 4 'data in rows 2-4
' Get the email address
Email = Cells(r, 2)
' Message subject
subj = "Testing email"
' Compose the message
Msg = ""
Msg = """This is <I>HTML / MIME</I> e-mail message sent from MS EXCEL VB script<BR>"
' Replace spaces with %20 (hex)
subj = Application.WorksheetFunction.Substitute(subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & subj & "&body=" & Msg
' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
' Wait two seconds before sending keystrokes
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
Next r
End Sub