Dear Team,
I am having code for send email with all the email address on the column I
My code is
Private Sub SendMail()
Dim olApp As Object
Dim olMail As Object
Dim olInsp As Object
Dim wdDoc As Object
Dim oRng As Object
Dim sPath As String
Dim sMessage As String
Dim sFile As String
Dim cell As Range
sMessage = "<br>" & "<font size=""3"" face=""Cambria"" color=""Blue"">" & "Dear Valuable Customer, <br><br>" _
& "Greetings!! </b><br><br>" _
& " On behalf of everyone from " & "<b> SCHWING STETTER INDIA PVT LTD,</b>" & " We would like to thank you for being a Customer/A Guest/An Investor.<br><br>" _
& " We value the trust you have put In our products, services and would like to thank you for that. It is always a pleasure serving you and we certainly look forward to doing that in the future.<br><br>" _
& " And We are happy to inform that we have designed a new catalogue of" & "<b> SCHWING STETTER </b>" & "products for the convenience of the customers to know about the products in detail for your requirement.<br><br>" _
& " Kindly find the " & "<b> SCHWING STETTER PRODUCT CATALOGUE.</b>" & "<br><br>" _
& " Your feedback is very important as we are constantly looking for ways to improve our services and products.<br><br>" _
& " Stay Safe! Stay Healthy!!<br><br>" _
sPath = Environ("USERPROFILE") & "\Desktop\Schwing product catalogue\"
Set olApp = CreateObject("Outlook.Application")
For Each cell In Columns("I").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "J").Value) = "" Then
On Error Resume Next
Set olMail = olApp.CreateItem(0)
With olMail
.BCC = cell.Value
.Subject = "GREETINGS FROM SCHWING STETTER!!!"
.HTMLBody = sMessage
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor 'access the message body for editing
.Display 'required to edit message body
sFile = Dir$(sPath & "*.pdf")
While sFile <> ""
.Attachments.Add sPath & sFile
sFile = Dir$()
Wend
End With
End If
Next cell
Set olApp = Nothing
Set olMail = Nothing
Set olInsp = Nothing
Set wdDoc = Nothing
Set oRng = Nothing
End Sub
Display More
I am having email Id column "I". when i run this code it will trigger n number of emails as per the email address available on column "I".
My condition is when i run this command only one mail should trigger and all the email address in column "I" should go to BCC.
And I want print "Mail Sent on " & Date" on column "J" for that particular mail ID.
For example ,
the mail triggered for "I4". So the "Mail Sent on " & Date" should print on "J4".
If the mail is triggered for "I6, I7 & I10". Then "Mail Sent on " & Date" should Print for "J6, J7 & J10".
i am attaching my sample file here for your reference.
Can any one help me to solve this.