Link to home
Start Free TrialLog in
Avatar of JesNoFear
JesNoFearFlag for United States of America

asked on

How to send an e-mail in VB6 with HTML

Hey everyone!
I am looking to make my program e-mail a daily report to a few pre-set e-mail accounts.
I'd like to be able to use html in the e-mail so the end result looks like what EE sends out when someone posts a comment to your question.
I would like it to match the GUI of my program.
I would like it to be able to support "Server requires auth to send mail" feature because My servers require that.
SOLUTION
Avatar of edwardiii
edwardiii

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
ASKER CERTIFIED SOLUTION
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 JesNoFear

ASKER

The content you insert into 'strFontControlBody' is html coding corrent?
are there returns needed between lines? '& chr(13) & chr(10) &'
SOLUTION
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
I keep getting a (The "SendUsing" configuration value is invalid.) messange when i try to use Shiju's solution....
never mind, it was my error
can u please place the code  u tried ?
try using this value

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1

i hadn't added the schemas.ms...... into it because i though it was only comments....
well, u got it working ;-)
Avatar of edwardiii
edwardiii

Hello, again.

Yes, the strFontControlBody contains HTML.  It was built from the contents of a Textbox; I had to replace all occurrences
of "vbNewLine" with "<br>" because in my Outlook emails, Outlook ignored the vbNewline code:

     strTxtAllConvert  = Replace(txtAll.Text, vbNewLine, "<br>")
     strFontControlBody = "<font face = MS Sans Serif size=3>" & strTxtAllConvert & "</font>"

Thank you for the points;)