formatted email body [Answered] LockedRSS

11 replies

Last post Dec 21, 2009 07:57 AM by tomkmvp

  • formatted email body

    Dec 17, 2009 06:02 AM|satyajitd|LINK

    hello friends... i want to send an email with html body i.e. table structure... Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="mymail@mydomain.com" myMail.To="someone@somedomain.com" myMail.HTMLBody = "

    This is a message.

    " myMail.Send set myMail=nothing in addition to above i want to add atable with some conditiuon like if a>b then 'print in first row a is greater than b 'print in second row b is smaller else 'print in first row a is smaler 'print in second row b is greater than a please help ...it is urgent...
  • Re: formatted email body

    Dec 17, 2009 09:08 AM|jeff@zina.com|LINK

     Where are you having trouble with this?  You'll need to build the body dynamically if you want the IF/THEN clause active.

    Jeff

    Have you Binged a solution before posting?
  • Re: formatted email body

    Dec 17, 2009 10:04 AM|tomkmvp|LINK

    satyajitd

    i want to send an email with html body

    http://support.microsoft.com/kb/286431

    satyajitd

    i want to add atable with some conditiuon like if a>b then 'print in first row a is greater than b 'print in second row b is smaller else 'print in first row a is smaler 'print in second row b is greater than a

    myMail.HTMLBody += "<table>"
    if a > b then
      myMail.HTMLBody += "<tr><td>a is greater than b</td></tr>"
      myMail.HTMLBody += "<tr><td>b is smaller</td></tr>"
    else
      myMail.HTMLBody += "<tr><td>a is smaller</td></tr>"
      myMail.HTMLBody += "<tr><td>b is greater than a</td></tr>"
    end if
    myMail.HTMLBody += "</table>"

    You're welcome ... : )

  • Re: formatted email body

    Dec 18, 2009 02:32 AM|satyajitd|LINK

    hi tomkmvp million thanks...
  • Re: formatted email body

    Dec 18, 2009 03:19 AM|satyajitd|LINK

    thanks once again... but my image is not displayed???
  • Re: formatted email body

    Dec 18, 2009 09:37 AM|tomkmvp|LINK

    What image? Nowhere in any of your posts do you ask about an image ...

  • Re: formatted email body

    Dec 19, 2009 03:20 AM|satyajitd|LINK

    ohh... in html body i have my company logo also... i want to display that ... the way above described is working for text only not for image...??? and again if i want to attach some file how to do that??? with cdosys i.e.cdo.message...
  • Re: formatted email body

    Dec 19, 2009 03:32 AM|steve schofield|LINK

    Make sure the link to your logo is an absolute link, http://www.example.com/images/logo.gif when constructing your HTML body.

    http://support.microsoft.com/kb/286431

    On a side note, here is a blog I did using ASP.NET to send.  Not sure if that helps.

    http://weblogs.asp.net/steveschofield/archive/2006/10/07/Send-a-Plain-Text-and-HTML-newsletter-using-System.Net.Mail-namespace.aspx

    it uses build-in .NET classes

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: formatted email body

    Dec 20, 2009 03:52 AM|satyajitd|LINK

    what about attachment???how to email a file as attachment???
  • Re: formatted email body

    Dec 20, 2009 08:33 AM|tomkmvp|LINK

    You have heard of Google or Bing, right?  : )

    http://www.google.com/search?q=cdo.message+attachment

  • Re: formatted email body

    Dec 21, 2009 12:12 AM|satyajitd|LINK

    yes iknow... but my code gives the error CDO.Message.1 (0x80070005) Access is denied
  • Re: formatted email body

    Dec 21, 2009 07:57 AM|tomkmvp|LINK

    I didn't realize you had two threads going on this ...

    http://forums.iis.net/p/1163429/1928439.aspx

    Let's keep it there.