Email list on Excell with template but missing Signature

Pheonix2332

New Member
Joined
Feb 3, 2021
Messages
20
Office Version
  1. 2013
Platform
  1. Windows
good afternoon all,

I've been tasked to contact over 500 companies my work deals with on a regular basis and need updated details from, I have collated an email sheet and have used the following code to produce the emails to each company, as I didn't want to fill out an additional column on every row I have used a text box with the pre filled in email with the greeting changing based on when the time of day changes i.e. morning/ afternoon, and within the email I'm using the web address we have for the company on record and their name. however I'm having difficulties getting my signature to remain on each email and having to manually add it back in every time this is the code am using -

VBA Code:
Sub send_mass_email()
    Dim i As Integer
    Dim Greeting, email, body, subject, business, Website As String
    Dim OutApp As Object
    Dim OutMail As Object
    
    body = ActiveSheet.TextBoxes("TextBox 1").Text
    
    i = 2
    'Loop down name column starting at row 2 column 1
    Do While Cells(i, 1).Value <> ""
        
        Greeting = Cells(i, 2).Value
        email = Cells(i, 3).Value
        body = ActiveSheet.TextBoxes("TextBox 1").Text
        subject = Cells(i, 4).Value
        business = Cells(i, 1).Value
        Website = Cells(i, 5).Value
    
    
   ' replace place holders
        body = Replace(body, "B2", Greeting)
        body = Replace(body, "A2", business)
        body = Replace(body, "E2", Website)
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
        With OutMail
             .to = email
             .subject = subject
             .body = body 
             .Display ' will be changed to send with works 
             
        End With
        
        'reset body text
        body = ActiveSheet.TextBoxes("TextBox 1").Text
        
        i = i + 1
    Loop
    
    Set OutMail = Nothing
    Set OutApp = Nothing
    MsgBox "Email(s) Sent!"
    
End Sub

if anybody can identify what can be changed or what I have missed will be greatly appreciated the textbox field is also below -


B2,

I am contacting you from Transit communications and have obtained your email address directly from your website E2

Could you please advise me of an email address for our client relations to contact A2 for any future enquiries relating to Transit Movements entering or leaving the UK.

This will enable your company to receive correspondence directly via email

Alternatively if you do not wish to be contacted via email let me know.


Kindly reply to this email at your earliest convenience.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
When you display an email, it's initialised with your signature. You're overwriting it.

you can check this by simply running
VBA Code:
    With OutMail
        .Display
    End With

You can try:
VBA Code:
        With OutMail
             .Display
             .to = email
             .subject = subject
             .body = body & .body
             '.Send ' will be uncommented to send with works
        End With

If you need to preserve your images too, Kato223 had a solution a few years back.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top