BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Banana19
Obsidian | Level 7

Hi All - I've encountered a scenario where I need to keep a certain word bold in an entire paragraph while sending an automated email using SAS.

Here is an example.

Hi all this your new colleague John Doe and he has 8 years of experience as Financial Analyst. You can fin his contact details in our intranet.....

 

Some one posted a scenario related to converting texting bold in an email and one of you guys posted the following link for reference. I looked at it and I do not think it is going to work for my scenario as the solution mentioned in the PDF is to use html tags and convert entire line in bold/colored not a single word.

 

I also have another question. Is it possible to keep a hyper link under the work in intranet in above example?

 

Below is the link I've mentioned.

060-2010: SMTP Email Access Method: Hints, Tips, and Tricks (sas.com)

 

It would be great if you could help with this issue. Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
kelxxx
Quartz | Level 8

I hope this can help you

filename memo Email 
				To=	("xxx@abc.com")		
				From="abc@xxx.com"
              	subject = "abc test"
				Type='TEXT/HTML'
				Content_type='TEXT/HTML'; 

data _null_ ;
		file memo ;
	put "Bonjour,";
	put /;
    put '<b><i><p><font color="#0000ff">
		// Cet email est pour un test
		</font></i></b></p>';
	put 'Hi all this your new colleague <b><font color="#ff0000">John Doe</font></b> and he has 8 years of experience as <b><font color="#ff0000">Financial Analyst</font></b>. You can fin his contact details in our intranet.....';
	put '<br>';
	put '<a href="https://communities.sas.com/t5/SAS-Programming/">Exemple hyper link: click here</a>';
	put '<br>';
	put "_______________________________________<br>";
	put "kelxxx<br>";

run;
filename memo clear;

kelxxx_0-1640342132702.png

 

View solution in original post

6 REPLIES 6
Reeza
Super User
Have you tried using PROC ODS TEXT to format your text component of the email message and using the options within PROC ODSTEXT?

That reference is 11 years old - probably outdated.
Banana19
Obsidian | Level 7
Sorry for delayed reply. I tried PROC ODS TEXT. It worked on PDF files but it didn't work on email body. Thank you!
ChrisNZ
Tourmaline | Level 20

> use html tags and convert entire line in bold/colored not a single word.

Just move the HTML tags to where you want the text formatted?

 

Hi all this your new colleague <b>John Doe</b> and he has

Banana19
Obsidian | Level 7
Sorry for delayed reply. The text is displayed in bold after using <b></b> tags.
kelxxx
Quartz | Level 8

I hope this can help you

filename memo Email 
				To=	("xxx@abc.com")		
				From="abc@xxx.com"
              	subject = "abc test"
				Type='TEXT/HTML'
				Content_type='TEXT/HTML'; 

data _null_ ;
		file memo ;
	put "Bonjour,";
	put /;
    put '<b><i><p><font color="#0000ff">
		// Cet email est pour un test
		</font></i></b></p>';
	put 'Hi all this your new colleague <b><font color="#ff0000">John Doe</font></b> and he has 8 years of experience as <b><font color="#ff0000">Financial Analyst</font></b>. You can fin his contact details in our intranet.....';
	put '<br>';
	put '<a href="https://communities.sas.com/t5/SAS-Programming/">Exemple hyper link: click here</a>';
	put '<br>';
	put "_______________________________________<br>";
	put "kelxxx<br>";

run;
filename memo clear;

kelxxx_0-1640342132702.png

 

Banana19
Obsidian | Level 7
It worked perfectly. Thank you!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2345 views
  • 6 likes
  • 4 in conversation