Suggestions on formatting an outgoing email message [message #181105] |
Sat, 13 April 2013 20:57 |
r.mariotti
Messages: 17 Registered: December 2011
Karma: 0
|
Junior Member |
|
|
In a very small php program that runs at the end of a daily
production job I generate an informational email message send to the
system administrator. No matter which of the two methods used below
to generate the message the results are received unformatted.
// generate email message method 1
$Mailmsg = "[abc.sh] Daily Results Retrieval Job\n\n";
$Mailmsg .= "One or more error(s) occured during the last\n";
$Mailmsg .= "execution of the above referenced script.\n\n";
$Mailmsg .= "$Errs\n";
$Mailmsg .= "Please review/research file daily.log\n";
$Mailmsg .= "for more details.\n";
// generate email message method 2
$Mailmsg = <<<EOD
[abc.sh] Daily Results Retrieval Job
One or more error(s) occured during the last
execution of the above referenced script.
$Errs
Please review/research file daily.log
for more details.
EOD;
Either one results in the received message being format as:
[abc.sh] Daily Results Retrieval Job One or more error(s) occured
during the last execution of the above referenced script. {content of
the $Errs file} Please review/research file daily.log for more
details.
I'm using PHPMailer to generate/send this message. I do, however, use
both these techniques in other programs with the same function and the
messages are formatted corrected.
Any suggestions/ideas?
Thanks
|
|
|
|
|
Re: Suggestions on formatting an outgoing email message [message #181108 is a reply to message #181105] |
Sun, 14 April 2013 00:22 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 4/13/2013 4:57 PM, BobMCT wrote:
> In a very small php program that runs at the end of a daily
> production job I generate an informational email message send to the
> system administrator. No matter which of the two methods used below
> to generate the message the results are received unformatted.
>
> // generate email message method 1
>
> $Mailmsg = "[abc.sh] Daily Results Retrieval Job\n\n";
> $Mailmsg .= "One or more error(s) occured during the last\n";
> $Mailmsg .= "execution of the above referenced script.\n\n";
> $Mailmsg .= "$Errs\n";
> $Mailmsg .= "Please review/research file daily.log\n";
> $Mailmsg .= "for more details.\n";
>
> // generate email message method 2
>
> $Mailmsg = <<<EOD
> [abc.sh] Daily Results Retrieval Job
>
> One or more error(s) occured during the last
> execution of the above referenced script.
>
> $Errs
> Please review/research file daily.log
> for more details.
> EOD;
>
>
> Either one results in the received message being format as:
>
> [abc.sh] Daily Results Retrieval Job One or more error(s) occured
> during the last execution of the above referenced script. {content of
> the $Errs file} Please review/research file daily.log for more
> details.
>
>
> I'm using PHPMailer to generate/send this message. I do, however, use
> both these techniques in other programs with the same function and the
> messages are formatted corrected.
>
> Any suggestions/ideas?
>
> Thanks
>
Are you sending the message as plain text or html? What does the
message source look like?
What's the rest of your code look like? Break it down to the minimum
necessary for us to recreate your problem.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
|