Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net embedded image in email body not showing in Yahoo but showing in Outlook

Hi

I use the VB.net function below to embed an image in the body of an Outlook message. As a test I sent the message to my business account (which I view in Microsoft Outlook) and to my personal Yahoo account. The image shows in the message of my business image (Image1 embedded below) but does not show in the message received in my Yahoo Inbox (Image2 embedded below)

    Function oBuild_HTML(ByVal oExcelRow As Integer, ByVal oInvoiceImageFile As String, _
                         ByVal strColumns As String, ByVal strFontName As String, _
                         ByVal strFontSize As String) As String
        Try
            Dim oHBody As String

            Dim arrSplit As Object = Split(strColumns, ",")
            Dim strExcelColumn As String
            Dim oExcelColumn As Integer
            Dim oCellValue As String


            For i As Integer = 0 To UBound(arrSplit)

                strExcelColumn = arrSplit(i)
                oExcelColumn = CInt(strExcelColumn)
                oCellValue = CStr(Sheet_Header_Source.Cells(oExcelRow, oExcelColumn).Value)

                If i = 0 Then
                    oHBody = "<html><body><font size=" & strFontSize & "  color=black name = '" & strFontName & "'>" & oCellValue & "</font></body></html>"
                Else
                    oHBody = oHBody & "<br>"
                    oHBody = oHBody & "<html><body><font size=" & strFontSize & "  color=black name = '" & strFontName & "'>" & oCellValue & "</font></body></html>"
                End If

            Next

            oHBody = oHBody & "<br>"
            oHBody = oHBody & "<img src = '" & oInvoiceImageFile & "'>"


            Return oHBody

        Catch ex As Exception
            MsgBox(ex.Message & " MM345")
            Return ""
        End Try
    End Function

User generated imageUser generated image
ASKER CERTIFIED SOLUTION
Avatar of Ramkisan Jagtap
Ramkisan Jagtap
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Jackie Man
Jackie Man
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thank you both!
Thanks very much
Incidentally my Yahoo settings were already set to that so not sure what to do

User generated image
Just msg you... send me a test email to troubleshoot the problem...
Thanks Jackie. I have sent the message. I appreciate the help.
After reading your email, I found out that you have asked a similar question in year 2014 and the expert answering your previous question suggested that there should be an alternative view to be added in the email as the vb script is designed for email client instead of a Web browser.

http://emoreau.com/Entries/Articles/2007/09/Using-SystemNetMail.aspx

The inline image in the email can only be rendered using Outlook as the image is actually a PDF object. If you need to have cross browser compatability, have a look of the methods in the link below.

http://stackoverflow.com/questions/466741/how-can-i-embed-a-pdf-in-an-email