Hello All,
I have a small problem but I have no idea how to solve this, so I want to send a few emails to one person, just not one by one like in the code, but as package or something.
For example:
Mail to Mr.A where's assigned a few positions should be send in one mail. In mailbody will be text + the numbers, which are assigned to him, but subject will be only "Reminder". But for Mr.BB, where's only one position the number should be send in subject + the "Reminder" like in the code.
Column A: Column B:
[TABLE="width: 493"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288014 [/TD]
[/TR]
[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288015[/TD]
[/TR]
[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288016[/TD]
[/TR]
[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288017[/TD]
[/TR]
[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288018[/TD]
[/TR]
[TR]
[TD]Mr.BB@mail.com[/TD]
[TD]#10288019[/TD]
[/TR]
[TR]
[TD]Mr.CC@mail.com[/TD]
[TD]#10288020[/TD]
[/TR]
[TR]
[TD]Mr.DD@mail.com[/TD]
[TD]#10288021[/TD]
[/TR]
[TR]
[TD]Mr.EE@mail.com[/TD]
[TD]#10288022[/TD]
[/TR]
[TR]
[TD]Mr.FF@mail.com[/TD]
[TD]#10288023[/TD]
[/TR]
</tbody>[/TABLE]
Thank you all for help.
I have a small problem but I have no idea how to solve this, so I want to send a few emails to one person, just not one by one like in the code, but as package or something.
For example:
Mail to Mr.A where's assigned a few positions should be send in one mail. In mailbody will be text + the numbers, which are assigned to him, but subject will be only "Reminder". But for Mr.BB, where's only one position the number should be send in subject + the "Reminder" like in the code.
Column A: Column B:
[TABLE="width: 493"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288014 [/TD]
[/TR]
[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288015[/TD]
[/TR]
[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288016[/TD]
[/TR]
[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288017[/TD]
[/TR]
[TR]
[TD]Mr.A@mail.com[/TD]
[TD]#10288018[/TD]
[/TR]
[TR]
[TD]Mr.BB@mail.com[/TD]
[TD]#10288019[/TD]
[/TR]
[TR]
[TD]Mr.CC@mail.com[/TD]
[TD]#10288020[/TD]
[/TR]
[TR]
[TD]Mr.DD@mail.com[/TD]
[TD]#10288021[/TD]
[/TR]
[TR]
[TD]Mr.EE@mail.com[/TD]
[TD]#10288022[/TD]
[/TR]
[TR]
[TD]Mr.FF@mail.com[/TD]
[TD]#10288023[/TD]
[/TR]
</tbody>[/TABLE]
Code:
LR = Cells(Rows.Count, 2).End(xlUp).Row
For x = 2 To LR
nr = nr + 1
MailFrom = Sheets("Start").Cells(2, 2).Value
MailTo = Range("A" & x).Value
MailSubject = "Reminder " & Range("B" & x).Value
MailBody = Sheets("Start").Cells(5, 2)
Set OutlookApp = CreateObject("Outlook.application")
Set OutlookMailitem = OutlookApp.CreateItem(0)
With OutlookMailitem
.Display
.SentOnBehalfOfName = MailFrom
.To = MailTo
.Subject = MailSubject
.Body = MailBody
.Send
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
Next x
Thank you all for help.