Jump to content
KickStarter15

[Solved] Add bold font in body text in email outlook

Recommended Posts

KickStarter15

Hi Experts,

I've searched in help and google on how to bold specific text in email body in outlook but the results are to bold all text in email body (which is not want I wanted). Is there a way we can have it like (i.e. "<b>Text</b>") in my code below? I've tried it but the mail received will have <b>Text</b> in the body.:(

$Body = "Dear All," & @CRLF & @CRLF & "Please see details below:" & @CRLF & @CRLF & "<b>Importance:</b>" & $aFormat & @CRLF & @CRLF & "<b>ErrorType:</b>" & $xFormat & @CRLF & @CRLF & @CRLF & "<b>Attached file: </b>" & "'" & GUICtrlRead($InputFile) & "'" & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & "Thank you!" & @CRLF & @UserName

Importance, ErrorType and Attached file must be set in bold font. Can this be done?

 

Thank you in advance.

KS15

Edited by KickStarter15

Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


Link to post
Share on other sites
KickStarter15

Hi Experts,

Found the cause why "<b>" bold is not generating in email outlook, its because of the below code:

If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then
        $objEmail.HTMLbody = $as_Body
    Else
        $objEmail.Textbody = $as_Body & @CRLF
    EndIf

Because it is converted to plain text where outlook won't allow any emphasis. However, when changing it using HTMLbody for outlook, seems @CRLF won't work and all text will be run-on as one paragraph.

I tried using @CRLF, @CR, @LF, but these line breakers won't work as well and did also with "Break" but still not working.

Any idea guys?

Example:

I have my email body wanted as this:

Dear All,

BlahBlahBlahBlahBlahBlahBlahBlahBlahBlah.

Thank you,

@Username

But the output from the code above is this:

Dear All, BlahBlahBlahBlahBlahBlahBlahBlahBlahBlah. Thank you, @Username:o

 

Thanks,

KS15


Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


Link to post
Share on other sites
KickStarter15

Found it Guys.:P

It's the "<BR>" function shall do the breaking.

 

Thanks

KS15


Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


Link to post
Share on other sites
Subz

Or <p></p> - Paragraph

Share this post


Link to post
Share on other sites
water

Or use Word as editor. How it works is explained in the _Ol_ItemCreate.au3 example of my OutlookEX UDF. 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×