Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

VbaHell

macrumors newbie
Original poster
May 7, 2011
1
0
I am trying to run this VBA macro from excel to auto send emails. This works fine with Outlook but not with the Mac Mail Client.
Has anyone in the MacRumors world got any VBA code to send via Mac Mail client


Sub DoALL()
Dim Mail_Object, Email_Subject, nameList As String, o As Variant
For i = 1 To 2
If Sheets("Mail").Range("c1").Value <> "" Then 'Change Sheet name to suit
nameList = nameList & ";" & Sheets("Mail").Range("I" & i).Value 'Change Sheet name to suit
End If
Next
Set Mail_Object = CreateObject("Outlook.Application")
With Mail_Object.CreateItem(o)
.Subject = "SUBJECT"
.To = nameList
.Body = "BODYTEXT" & Chr(13) & Chr(13) & "Regards," & Chr(13) & "VbaHell"
.Send
End With
MsgBox "E-mail successfully sent", 64
Application.DisplayAlerts = False
Set Mail_Object = Nothing
End Sub
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.