Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

having issue with colon in send mail message body... 1

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
i'm having a time trying to figure out how to pass a colon (no pun!) through to the body of my mail, using sendmail.

unless i put the actual colon in the body, the body doesn't display at all.

Code:
$e='[URL unfurl="true"]http://joeblow.com';[/URL]

open (MAIL, "|/usr/sbin/sendmail -t") || return 0;
select (MAIL);
print << "EOF";
To: Joe Blow <joe\@blow.com>
From: My Company <my\@company.com>
Subject: My Subject Here
$e
EOF

close (MAIL);
select (STDOUT);

the above shows the body as blank. i can't figure it out.

this works, however:
Code:
open (MAIL, "|/usr/sbin/sendmail -t") || return 0;
select (MAIL);
print << "EOF";
To: Joe Blow <joe\@blow.com>
From: My Company <my\@company.com>
Subject: My Subject Here
[URL unfurl="true"]http://joeblow.com[/URL]
EOF

close (MAIL);
select (STDOUT);

man, this doesn't make sense to me. can anyone help?

thanks!

- g
 
There really should be two newlines after the subject header. I also recommend you use a more modern quoting operator like qq:

Code:
$e='[URL unfurl="true"]http://joeblow.com';[/URL]
open (MAIL, "|/usr/sbin/sendmail -t") || return 0;
select (MAIL);
print qq{
To: Joe Blow <joe\@blow.com>
From: My Company <my\@company.com>
Subject: My Subject Here

$e
};
close (MAIL);
select (STDOUT);


------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top