Gossamer Forum
Home : General : Perl Programming :

No Linebreaks when sending Emails via PerlScript

Quote Reply
No Linebreaks when sending Emails via PerlScript
Hi!
That's actually my problem: allthough entered correctly in the .txt templates, respectively within the PerlScript itself some (!) of the mails are being sent with incorrect "return"-formatting. There are no linebreaks shown.

What I found out so far is that this concerns some Emailprograms only, i.e. MS Outlook 2000 has problems, whereas MS Outlook Express in an older version shows the mail correctly. F... for MS!

Has anybody an idea what might be wrong? \n and ~s\n etc. didn't work so far.

Here's a part of the script in which 'incorrect' mails are being set up:


#BNB SAYS! Modify the lines below between the lines marked
# with __STOP_OF_MAIL__ to customize your e-mail message
# DO NOT remove the lines that contain __STOP_OF_MAIL__!
# If you enter any hardcoded e-mail addresses, BE SURE TO
# put the backslash before the at sign, ie, me\@here.net

$msgtxt = <<__STOP_OF_MAIL__;
Hallo $fields{$recipname},

$fields{'send_name'} hat im "$SITE_NAME" die folgende Internetseite gefunden,
und empfiehlt Dir sie mal zu besuchen:

Titel der Seite: $rec{'Title'}
URL der Seite: $rec{'URL'}
Beschreibung der Seite, wie Sie im Webverzeichnis für Motorradfahrer eingetragen ist:
$rec{'Description'}

Da gibt's was tolles über Motorräder!

__STOP_OF_MAIL__

if ($fields{'message'} ne "")
{
$msgtxt .= "Hier ist noch eine persönliche Nachricht von $fields{'send_name'}....\n";
$msgtxt .= "---------------------------------------------------------------------\n\n";
$msgtxt .= "$fields{'message'}\n\n";
$msgtxt .= "---------------------------------------------------------------------\n\n";
}
$msgtxt .= "$ENDLINE\n";
$msgtxt .= "$SITE_URL\n\n";
$mailresult = &sendmail(
$fields{send_email},
$fields{send_email},
$fields{$recipemail},
$SMTP_SERVER,
$subject,
$msgtxt,
$carbon
);

if ($mailresult ne "1")
{print "Content-type: text/html\n\n";
print "MAIL NOT SENT. SMTP ERROR: $mailresult\n";
exit
}

}
}

##################################################################

Thanks for suggestions,
Denis

Btw: here's the sendmail config:
$SEND_MAIL="/usr/sbin/sendmail -t";
Should I use other options, but -t?
What does that -t mean?

[This message has been edited by Denis (edited February 10, 2000).]
Quote Reply
Re: No Linebreaks when sending Emails via PerlScript In reply to
I changed the sendmail config to that:

$SEND_MAIL="|/usr/sbin/sendmail -t -oeq";

Looks, as if the -oeq and the | did it, at least also MS outlook 2000 receives the mails fine know.

What's also working (maybe better, i don't know yet) correctly, is changing the mailhandler to your smtp Server.

This info for all who are interested.