Gossamer Forum
Home : General : Perl Programming :

Problem with sendmail

Quote Reply
Problem with sendmail
Hi all,

I wrote a script that sends email:

But in the some server this works well but in some server the line breaks are all wrong and difficult to read.

Please give me the advise to figure out with this.

Thanks in advance,

Beck
Quote Reply
Re: [Beck] Problem with sendmail In reply to
You may need to show the code and the output to make things clearer.
Quote Reply
Re: [Paul] Problem with sendmail In reply to
Thanks Pauls,

--------------------------------------------


$message = qq~

Dear Name,

This e-mail has been sent to confirm that this is a valid e-mail address.


Please confirm your registration by clicking on the following URL:


Your e-mail address will only be used to send you notification.

Your e-mail address will not be visible to other users.

Regards,

~;
$to = 'admin@abc.com';
$from = 'test@abc.com';
$subject = "test";
sendmail($to,$cc,$from,$subject,$message);


sub sendemail {
# ----------------------------------------------------------------
#
# Send mail procedure
#
my ($to,$cc,$from,$subject,$message) = @_;
$mailprog = "/usr/sbin/sendmail -t";

open MAIL, "|$mailprog";
print MAIL "To: $to\r\nFrom: $from\r\nSubject: $subject\r\n\r\n$message\r\n\r\n";
close MAIL;


}

-----------------------------------------------------------------

But in some server I can receive the message with exact format I want but in some server I receive the message link that:

Dear Name,This e-mail has been sent to confirm that this is a valid e-mail address.Please confirm your registration by clicking on the following URL:Your e-mail address will only be used to send you notification.Your e-mail address will not be visible to other users.Regards,

Please advise what I do wrong.



Thanks in advance,



Beck
Quote Reply
Re: [Beck] Problem with sendmail In reply to
You may need to use <BR> tags on some servers...it really depends on how the mail program is reading it. Have you tried setting the MIME type?

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Problem with sendmail In reply to
Hi,

I try either to add <br> or \n but nothing happen.

Is there any option in sendmail program that I am missing.

Thanks in advance,

Dai Nguyen
Quote Reply
Re: [Beck] Problem with sendmail In reply to
Yeah..a MIME header ;) Read up at perldoc.com or similar. I've never used it...but I know from experience with PHP that similar things happen. Some mail proggys have no problem with reading using the \n, but others need the MIME type set Frown

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Beck] Problem with sendmail In reply to
You need to set a content-type eg...

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

Last edited by:

Paul: Jun 24, 2002, 6:13 AM