Pictures in Emails sent by VBA don't appear on android and iphone mail

islamswidan

New Member
Joined
Mar 1, 2014
Messages
4
Hello friends,
I am having a problem that pictures my generated mails by VBA appear totally normal on outlook but on mobile mail clients (android and iphone) all pictures are like boxes with "x" on them however they are found in the attachments.
On the other hand, when I re-send this same mail again from outlook manually, all pictures appear on mobile.

Does any one have a solution of this please?

Thanks,
Islam Swidan
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
How are you generating the emails?
 
Upvote 0
Hello Norie,
Below the code I am using from which the picture appears normally on outlook while not on mobile mail clients.

Code:
Public Sub MailBuilder()
 
    Windows("Anritsu_Diamond_Daily_Report.xlsm").Activate
    Dim OutApp As Object
    Dim OutMail As Object
    Dim MyMessageSubject As String
    Dim Day1 As String
    Dim Month1 As String
    Dim year1 As String
    Dim Fname3 As String
 
    Fname3 = Environ$("temp") & "\UnHappyCustomers.gif"
    ActiveWorkbook.Worksheets("UnhappyCustomers").ChartObjects("UnHappyCustomers").Activate
    ActiveWorkbook.Worksheets("UnhappyCustomers").ChartObjects("UnHappyCustomers").Chart.Export _
            Filename:=Fname3, FilterName:="GIF"
    MyMessageSubject = Date
    Day1 = Day(MyMessageSubject)
    Month1 = Month(MyMessageSubject)
    year1 = Year(MyMessageSubject)
 
    With Application
        .EnableEvents = False
        .ScreenUpdating = False
    End With
 
    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)
   
    On Error Resume Next
    With OutMail
        .To = "[EMAIL="Islam.Swidan@Etisalat.com"]Islam.Swidan@Etisalat.com[/EMAIL]"
        .CC = ""
        .BCC = ""
        .Attachments.Add Fname3
        .Subject = "Diamond Customers Experience - Anritsu | " + Day1 + "-" + Month1 + "-" + year1
        .HTMLBody = "<H1 align=""center""><img src='UnHappyCustomers.gif'/></H1>"
        .SentOnBehalfOfName = "[EMAIL="TechnicalCustomerExperience.EG@etisalat.com"]TechnicalCustomerExperience.EG@etisalat.com[/EMAIL]"
        .Send   'or use .Display
    End With
    On Error GoTo 0
    With Application
        .EnableEvents = True
        .ScreenUpdating = True
    End With
    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub
 
Last edited:
Upvote 0
The board has tried to render the HTML in your code.

Try posting that part again but within HTML tags.
 
Upvote 0
This is the missing part:

.HTMLBody = "img src='UnHappyCustomers.gif'/"

Just put < and > before and after the above line

Is that clear ?
 
Upvote 0
Try this for the HTMLBody.
HTML:
<IMG src=cid:'UnHappyCustomers.gif'>
 
Upvote 0
Thanks Norie for your reply, unfortunately, when I tried this the picture disappeared from both outlook and on mobile :(
Any other advice?
 
Upvote 0

Forum statistics

Threads
1,217,363
Messages
6,136,108
Members
449,993
Latest member
Sphere2215

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