dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: HTML emails in SMTP - how to format?

  1. #1
    Join Date
    Oct 2013
    Posts
    8

    HTML emails in SMTP - how to format?

    Hello

    I have a Web page in vb.net that sends an HTML email using SMTP. This HTML email contains a banner image (600px x 98px) along the top and a background image (600px x 600px) that fills in the main body of the message. The email informs users about to reset their forgotten password.

    However, the text that informs users about to reset their forgotten password is pushed below the background image instead of appearing on top of it. That part of my SMTP code which deals with sending emails in HTML format looks like this:

    Code:
     
    myMessage.Body = ""
    myMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
    myMessage.IsBodyHtml = True
    myMessage.Priority = MailPriority.Normal
    
    Dim mimeType As ContentType = New ContentType("text/html")
    Dim HtmlMessage As AlternateView = AlternateView.CreateAlternateViewFromString("<img src=cid:dimaHeader><br /><br /><img src=cid:Back2a><br /><br /><br /><body style='font-family, etc. Text here</body>", Nothing, "text/html")
    
    Dim Logo As New LinkedResource(Server.MapPath("~/Images/dimaHeader.jpg"), "image/jpeg") 'embedded image
    Logo.ContentId = "dimaHeader"
    HtmlMessage.LinkedResources.Add(Logo)
    
    Logo = New LinkedResource(Server.MapPath("~/Images/Back2a.jpg"), "image/jpeg") 'embedded image
    Logo.ContentId = "Back2a"
    HtmlMessage.LinkedResources.Add(Logo)
    
    myMessage.AlternateViews.Add(PlainMessage)
    myMessage.AlternateViews.Add(HtmlMessage)
    How do I get the text to appear over the background image (Back2a.jpg), please.

    Thanks!

  2. #2
    Join Date
    Mar 2017
    Location
    Toronto
    Posts
    17
    I got the same issue so far...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center