Jacque Scott
asked on
Send mass email to friends
I want to be able to send an email to all my friends in my Outlook address book. It's almost like a spam message, like from buy.com or something like that. since I want to format the email with pics and stuff. I just changed jobs to sell jewelry and I want to let my friends know about this change and what deals they can get if they buy this jewelry. I don't know what this type of email would be called so I can't do a search to see if there is already an answer to my question.
I would appreciate any help.
I would appreciate any help.
So you want to send individual emails but with similar content? Do you want to address your friends by name?
ASKER
Yes, I want to send a message to all my friends by name but with the same body of information.
Ok, well I may be assuming some things but you let me know.
Here is the code you would past in your VB Macro
Sub SendSpam()
Dim folder As Folders
Dim drafts As MAPIFolder
Dim ns As NameSpace
Set ns = Application.GetNamespace(" MAPI")
Set folder = ns.GetDefaultFolder(olFold erInbox).F olders
Set drafts = ns.GetDefaultFolder(olFold erDrafts)
Dim objCont As MAPIFolder
Set objCont = ns.GetDefaultFolder(olFold erContacts )
Dim template As MAPIFolder
Set template = folder.Item(1)
Dim itm As MailItem
Dim cnt As ContactItem
For Each cnt In objCont.Items
For Each itm In template.Items
itm.Copy
Set itm = itm.Move(drafts)
itm.To = cnt.Email1Address
itm.Body = Replace(itm.Body, "${name}", cnt.FirstName)
itm.Save
'itm.Send ' Uncomment this line to automatically send them
Next
Next
End Sub
' End VB Macro
Then what I did was I created a folder underneath my inbox and called it template. Then I entered in my Subject line and body like so
Subject: Cool
Hey ${name}, I just wanted to say something to you. OK?
Later.
As you can see I am using ${name} as the place holder for the name. You can add more and I hope my example gives you enough to generalize the enhancement.
Please let me know what you think and if you have any questions.
The way I ran this was by just going to Tools > Macro > Macros and running the ThisOutLookSession.SendSpa m
Let me know
Tone
Here is the code you would past in your VB Macro
Sub SendSpam()
Dim folder As Folders
Dim drafts As MAPIFolder
Dim ns As NameSpace
Set ns = Application.GetNamespace("
Set folder = ns.GetDefaultFolder(olFold
Set drafts = ns.GetDefaultFolder(olFold
Dim objCont As MAPIFolder
Set objCont = ns.GetDefaultFolder(olFold
Dim template As MAPIFolder
Set template = folder.Item(1)
Dim itm As MailItem
Dim cnt As ContactItem
For Each cnt In objCont.Items
For Each itm In template.Items
itm.Copy
Set itm = itm.Move(drafts)
itm.To = cnt.Email1Address
itm.Body = Replace(itm.Body, "${name}", cnt.FirstName)
itm.Save
'itm.Send ' Uncomment this line to automatically send them
Next
Next
End Sub
' End VB Macro
Then what I did was I created a folder underneath my inbox and called it template. Then I entered in my Subject line and body like so
Subject: Cool
Hey ${name}, I just wanted to say something to you. OK?
Later.
As you can see I am using ${name} as the place holder for the name. You can add more and I hope my example gives you enough to generalize the enhancement.
Please let me know what you think and if you have any questions.
The way I ran this was by just going to Tools > Macro > Macros and running the ThisOutLookSession.SendSpa
Let me know
Tone
Oh this goes through your complete address book and sends the email.
Also change
Set template = folder.Item(1)
to
Set template = folder.Item("template")
Set template = folder.Item(1)
to
Set template = folder.Item("template")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.