bsharath
asked on
Send amil to a user with many in CC.Need to automate the process.
Hi,
Need to send mails every day to many users for their Birthdays.What is the best way of doing this.This is sent to the user in the To and the whole staff that are in a group in the CC.
Is there a easy way of doing this.Every user has to get invividual mails and the whole staff in Cc.Name has to be as
Hi username
and the user in the To tab.
The others in the CC
The mail has backgroud and pictures in it. Any way to automate this or any better ideas are appretiated.
Any help with this.
Regards
Sharath
Need to send mails every day to many users for their Birthdays.What is the best way of doing this.This is sent to the user in the To and the whole staff that are in a group in the CC.
Is there a easy way of doing this.Every user has to get invividual mails and the whole staff in Cc.Name has to be as
Hi username
and the user in the To tab.
The others in the CC
The mail has backgroud and pictures in it. Any way to automate this or any better ideas are appretiated.
Any help with this.
Regards
Sharath
ASKER
I have a excel that has
Colum A Name and Colum B the date in MM/DD/YYY format
Yes all messages will be Cc'd to the same group always just the names will differ
Colum A Name and Colum B the date in MM/DD/YYY format
Yes all messages will be Cc'd to the same group always just the names will differ
ASKER
Any help....
Try this. It will mail a birthday message to every entry in the spreadsheet. We can modify it to only send messages to birthdays matching today's date or to those within a certain number of days of today.
Sub SendBirthdayMessage()
Dim excApp As Object, _
excBook As Object, _
excSheet As Object, _
olkMessage As Outlook.MailItem, _
intRow As Integer
Set excApp = CreateObject("Excel.Application")
'Change the file name and path on the following line as needed
Set excBook = excApp.Workbooks.Open("C:\eeTesting\Birthdays.xls")
Set excSheet = excBook.Worksheets(1)
intRow = 1
Do Until excSheet.Cells(intRow, 1) = ""
Set olkMessage = Application.CreateItem(olMailItem)
With olkMessage
.Recipients.Add excSheet.Cells(intRow, 1)
.Recipients.ResolveAll
'Change the subject line as needed
.Subject = "Happy Birthday"
'Insert your HTML on the following line. You can insert the HTML directly or read it in from a file. The HTML can be anything you want it to be.
.HTMLBody = "Your HTML goes here"
.Send
End With
Set olkMessage = Nothing
Loop
excBook.Close False
Set excSheet = Nothing
Set excBook = Nothing
Set excApp = Nothing
MsgBox "All done.", vbOKOnly + vbInformation, "Send Birthday Greetings"
End Sub
ASKER
How should the data in the excel be.
Can you modify according to this Question please...
https://www.experts-exchange.com/questions/22997456/Excel-Macro-to-send-mail-according-to-the-date-to-all-next-to-the-date.html
Can you modify according to this Question please...
https://www.experts-exchange.com/questions/22997456/Excel-Macro-to-send-mail-according-to-the-date-to-all-next-to-the-date.html
ASKER
BluedevilFan...
Here are some posts which i feel you can help...posting them here if you have missed seeing them...
https://www.experts-exchange.com/questions/22997550/Outlook-Macro-to-move-all-Follow-up-checked-mails-to-a-folder-specified.html
https://www.experts-exchange.com/questions/22997561/Any-way-to-set-a-reminder-for-the-follow-up-automatically-for-30-min.html
https://www.experts-exchange.com/questions/22997514/Form-for-a-new-Computer-request.html
Here are some posts which i feel you can help...posting them here if you have missed seeing them...
https://www.experts-exchange.com/questions/22997550/Outlook-Macro-to-move-all-Follow-up-checked-mails-to-a-folder-specified.html
https://www.experts-exchange.com/questions/22997561/Any-way-to-set-a-reminder-for-the-follow-up-automatically-for-30-min.html
https://www.experts-exchange.com/questions/22997514/Form-for-a-new-Computer-request.html
Well, according to what you posted in this question the data would be in the format
Name Birthday
Sharath 12/12/1967
If you want to change it to this format
Bdate Date Username Email Address Groupname Username/Groupname
12/12/1967 Sharath Sharath@plc.com Group1 User1/group1
then use the code below
Name Birthday
Sharath 12/12/1967
If you want to change it to this format
Bdate Date Username Email Address Groupname Username/Groupname
12/12/1967 Sharath Sharath@plc.com Group1 User1/group1
then use the code below
Sub SendBirthdayMessage()
Dim excApp As Object, _
excBook As Object, _
excSheet As Object, _
olkMessage As Outlook.MailItem, _
intRow As Integer
Set excApp = CreateObject("Excel.Application")
'Change the file name and path on the following line as needed
Set excBook = excApp.Workbooks.Open("C:\eeTesting\Birthdays.xls")
Set excSheet = excBook.Worksheets(1)
intRow = 1
Do Until excSheet.Cells(intRow, 1) = ""
If CDate(excSheet.Cells(intRow, 1) = Date() Then
Set olkMessage = Application.CreateItem(olMailItem)
With olkMessage
.Recipients.Add excSheet.Cells(intRow, 3)
.Recipients.ResolveAll
.CC = excSheet.Cells(intRow, 4)
'Change the subject line as needed
.Subject = "Happy Birthday"
'Insert your HTML on the following line. You can insert the HTML directly or read it in from a file. The HTML can be anything you want it to be.
.HTMLBody = "Your HTML goes here"
.Send
End With
Set olkMessage = Nothing
Loop
excBook.Close False
Set excSheet = Nothing
Set excBook = Nothing
Set excApp = Nothing
MsgBox "All done.", vbOKOnly + vbInformation, "Send Birthday Greetings"
End Sub
ASKER
Is this a outlook macro?
I get a compile error here
If CDate(excSheet.Cells(intRo w, 1) = Date() Then
Is a Bracket missing?
I get a compile error here
If CDate(excSheet.Cells(intRo
Is a Bracket missing?
ASKER
For both the questions its the same results that i need.
1. Automate the process in outlook to find the date and if the date is todays date then send a mail to all the bday members with some users in CC.
1. Automate the process in outlook to find the date and if the date is todays date then send a mail to all the bday members with some users in CC.
Oops, sorry. Yes, it is an Outlook macro and yes a parenthesis is missing. The line should read
If CDate(excSheet.Cells(intRo w, 1)) = Date() Then
If CDate(excSheet.Cells(intRo
ASKER
I get this
-------------------------- -
Microsoft Visual Basic
-------------------------- -
Compile error:
Loop without Do
-------------------------- -
OK Help
-------------------------- -
--------------------------
Microsoft Visual Basic
--------------------------
Compile error:
Loop without Do
--------------------------
OK Help
--------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get a Run time error 13
in this line when clicked debug
If CDate(excSheet.Cells(intRo w, 1)) = Date Then
in this line when clicked debug
If CDate(excSheet.Cells(intRo
ASKER
Any help...
ASKER
Any help...
ASKER
David if time permits plz have a look on this...
Sharath,
Hope you are doing good.
Did you get any update on this?
regards
Chandru
Hope you are doing good.
Did you get any update on this?
regards
Chandru
ASKER
Hi Chandru long time....i am fine how are you...
>>Did you get any update on this?
Sorry could not follow
>>Did you get any update on this?
Sorry could not follow
i was out of country for a project and a bit busy.
Did you get this birthday greetings working?
Chandru
Did you get this birthday greetings working?
Chandru
ASKER
Not exactly chandru i get the Runtime error.
ASKER
Not exactly chandru i get the Runtime error.
i would also require this for birthday wishes. I am not sure about macros in excel.
How do you keep track of their birthdays, and will all messages be cc'd to the same group of people? If not, how can we tell who is cc'd on which messages?