• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Bulk mailer VBA

Status
Not open for further replies.

ushaanu

Member
HI All .

I am using following code and it send bulk mailer with one attachment from excel sheet .

now i need add one common image in mail body in place of attachment.

>>> You have already noted May 2023 <<<
>>> use code - tags <<<
Code:
Sub Send_Email_with_Signature()

Dim Outlook_App As Object
Dim msg As Object
Dim sign As String
Dim i As Integer
Set Outlook_App = CreateObject("Outlook.Application")
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Data")
 
For i = 3 To sh.Range("C" & Application.Rows.Count).End(xlUp).Row

If sh.Range("A" & i).Value = "" Then  ''Check Skip
   
    Set msg = Outlook_App.CreateItem(0)
   
    With msg
        .display
    End With
   
    sign = msg.HTMLBody
    With msg
        .To = sh.Range("D" & i).Value
        .CC = sh.Range("E" & i).Value
        .Subject = " Wishes from Service !" & " " & "" & sh.Range("B" & i) & ""
        .HTMLBody = "<big>Dear <big>" & sh.Range("C" & i).Value & "<br><br><p style='color:#0000FF;'>Greetings from XYS!</p>" & _
        "<p style='color:#0000FF;'<Midium>We are grateful for your trust and support in our products and services </p>" & _
        "<p style='color:#0000FF;'<Midium>Team wish you a very happy brihday.</p>" & _
        "<p style='color:#0000FF;'<Midium>May this year bring you joy, peace, and success in all your endeavors..</p>" & _
        sign
         If sh.Range("G" & i).Value <> "" Then
         End If


        If sh.Range("J1").Value = 1 Then  ''' check option button value
            .send
        Else
            .display
        End If
    End With
   
    Set msg = Nothing

End If

Next i


Set Outlook_App = Nothing

If sh.Range("H1").Value = 1 Then MsgBox "Done"

End Sub
 

Attachments

  • Welcome Letter macro_.xlsm
    25.7 KB · Views: 0
Last edited by a moderator:

ushaanu

You've had same code with Your May 2023
Please continue with that thread.
 
Status
Not open for further replies.
Back
Top