CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Bolding Email Text

 



WhatWebs
stranger

Jan 24, 2001, 4:58 PM

Post #1 of 10 (1981 views)
Bolding Email Text Can't Post

How do I make text bold within an email that is constructed within a cgi script? I don't see any special characters or tags to do that. Thank you.



Merlin
journeyman

Jan 24, 2001, 5:02 PM

Post #2 of 10 (1980 views)
Re: Bolding Email Text [In reply to] Can't Post

First, after you declare your To: From: and Subject: lines, use the following :

print MAIL "Content-type:text/html\n\n";

This puts the rest of the mail in HTML mode so you just have to use HTML tags to do bold...

print MAIL "<b>This text is bold in the e-mail</b>";

This should do it...



pu_nk
journeyman

Jan 24, 2001, 7:03 PM

Post #3 of 10 (1976 views)
Re: Bolding Email Text [In reply to] Can't Post

Just to add so you dont have any problems..

Makes sure you dont put the \n\n" a the end of the Subject line.
So this are in the mail would look like so..

print MAIL "Subject: Subject Here\n";
print MAIL "Content-type: text/html\n\n";

your e-mails will look so much better now if you make them all in html format. ( you can now add any HTML code and it will appear in the email)

Drew



WhatWebs
stranger

Jan 25, 2001, 6:14 PM

Post #4 of 10 (1970 views)
Re: Bolding Email Text [In reply to] Can't Post

Thank you very much to both of you. I will try this.



Cure
User

Jan 27, 2001, 9:13 AM

Post #5 of 10 (1961 views)
Re: Bolding Email Text [In reply to] Can't Post

open (MAIL, "|/usr/bin/sendmail -t") || die "Can't open mailprogram $!\n";
print MAIL <<END_OF_MAIL;
To: $Guru
From: $me
Subject: $boo
Content-Type: text/html\n\n
<html><body><b>Perl loves you</b></body></html>
END_OF_MAIL
close (MAIL);


Cure



WhatWebs
stranger

Jan 28, 2001, 7:07 PM

Post #6 of 10 (1949 views)
Re: Bolding Email Text [In reply to] Can't Post

When I try to implement that code, I get the "This page cannot be displayed error". This is all I have:
open (MAIL, "|/usr/bin/sendmail -t") || die "Can't open mailprogram $!\n";
print MAIL <<END_OF_MAIL;
To: $Expert
Content-Type: text/html\n\n
<html><body><b>Perl loves you</b></body></html>
END_OF_MAIL
close (MAIL);
I'm pretty sure it's either the open stmt that is causing me probs or the redirection. The "<<" does mean redirection in this context doesn't it? Thanks!



modified
Deleted

Jan 29, 2001, 12:36 PM

Post #7 of 10 (1938 views)
Re: Bolding Email Text [In reply to] Can't Post

Page Cannot Be Displayed probably means that your script isn't producing an HTML output.



WhatWebs
stranger

Jan 29, 2001, 2:44 PM

Post #8 of 10 (1935 views)
Re: Bolding Email Text [In reply to] Can't Post

Okay, so why isn't it producing HTML? If I could get this working, it would really enhance the emails I put together.



Jasmine
Administrator / Moderator

Jan 29, 2001, 3:21 PM

Post #9 of 10 (1933 views)
Re: Bolding Email Text [In reply to] Can't Post

When you send mail using a cgi form, there should be 2 parts for you to program in: 1) the actual sending of email (whether or not the body of the email is in html), and 2) something to be displayed to the browser, such as a confirmation message.

Just because your email is in html doesn't mean that it's supposed to display something in the browser -- you need to create an html page to display. So it sounds like the answer to your "why isn't it producing html" is that you haven't created anything to display in the browser :}



WhatWebs
stranger

Jan 30, 2001, 8:06 AM

Post #10 of 10 (1928 views)
Re: Bolding Email Text [In reply to] Can't Post

Okay, perhaps I need to clarify. I'm under the impression that the bolding via html produces an email msg that when opened in Outlook (or whatever) has html properties. I've gotten a number of msgs like that and I'd love to be able to produce emails like that. However, it sounds like I have the wrong impression of what will be output via html. I've worked with cgi scripts/forms for over a year, creating email msgs and html Thank You pages, but I've not ventured too much past that. The request for bolding within the email has made me investigate further. Can you clarify for me? Thank you for your help.


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives