• 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.

added image in OutMail.HTMLBody comes blank

drom

New Member
Hi and Thanks in advance!!

I have a Macro that works very well when I have to send eMails to say 50 people through OutLook using VBA

I am adding a Image located sometines on a WEB, sometimes in my drive
That works ok

My Problem If I don't do

.DISPLAY before sending the mail
the attached images are coming whites

I thought I needed to use:
Code:
 Application.Wait Now() + TimeValue("00:00:03")
but does not work

SO my question:


IS IT MANDATORY to use .display to sent a mail if I want to see the attached images within the OutMail.HTMLBody ???

PS: my code:
Code:
    With OutMail
      .To = wEmail                    'wEmail    = "aaa@gmail.com"
      .Subject = wSubject             'wSubject  = "Ref.: My JOB"
      .Body = wTextBody               'wTextBody = "Hi there..."
      .Attachments.Add wFN, , 0       'wFN       = "C:\000_ExcelProjects\Fagor\Images\myImage.JPG"
                                      'wN        = "myImage.JPG"
      .HTMLBody = .HTMLBody & "<br>" & "<img src='cid:" & wN & "'" & "width='" & xWidth & "' height='" & xHeight & "'><br>"   '''OK
      .HTMLBody = .HTMLBody & "<br>"
      'Application.Wait Now() + TimeValue("00:00:02")
      'IF I DONT do:
      '.display 'before sending the image comes BLANK
      .send
    End With
       
    Set OutApp = Nothing:                 Set OutMail = Nothing

If I use .display the image comes PERFECT
 
Back
Top