Page 1 of 1

Mail being stupid

Posted: Wed Mar 24, 2004 6:12 pm
by magicrobotmonkey
I'm trying to do mime mail heres my headers

Code: Select all

<?php

$headers ="
From: Cml Admin <assessments@xxxxxx.com>
To: Aaron Bassett <abassett@xxxxxx.com>
Subject: Here is your stuff!
Date: Wed, 20 Jun 2001 20:18:47 -0400
MIME-Version: 1.0
Content-Type: text/plain
charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Why??!";
?>
And here's the body of the message:
charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Hello from Zend.com!

and here's the mail fxn:

Code: Select all

<?php
include "help.inc";

echo $headers;

 mail("abassett@cml-1885.com", "hip", " ",$headers);
?>
So why does that shtuff show up when it should be getting processed or whatever? Think its my server? I dont know how to test it Thanks

Posted: Wed Mar 24, 2004 6:48 pm
by Buddha443556
Try adding to "\r\n" to the end of each headers. Concatenate the string using the dot notation. Something like this:

Code: Select all

$header = "From: Cml Admin <assessments@xxxxxx.com>\r\n"
                      . "To: Aaron Bassett <abassett@xxxxxx.com>\r\n"
                      . "Subject: Here is your stuff!\r\n"
                      . "Date: Wed, 20 Jun 2001 20:18:47 -0400\r\n"
                      . "MIME-Version: 1.0\r\n"
                      . "Content-Type: text/plain\r\n" 
                      . "charset=iso-8859-1\r\n"
                      . "Content-Transfer-Encoding: 7bit"

Posted: Thu Mar 25, 2004 6:42 am
by magicrobotmonkey
I have this:

Code: Select all

<?php

$headers =
"From: Cml Admind <assessments@xxxxxxxxxcom> \r\n"
."To: Aaron Bassett <abassett@xxxxxxxxx.com> \r\n"
."Subject: Here's your stuff \r\n"
."Date: Wed, 20 Jun 2001 20:18:47 -0400 \r\n"
."MIME-Version: 1.0 \r\n"
."Content-Type: text/plain; \r\n"
."charset=iso-8859-1 r\n"
."Content-Transfer-Encoding: 7bit \r\n"
."Hello from The Company!";

?>
And it still doesn't work. And when It echos to the webpage when I run it it shows it witout the line breaks. I tried changing them to just \n and htat didnt work either.

Posted: Thu Mar 25, 2004 11:02 am
by Buddha443556
magicrobotmonkey wrote:

Code: Select all

<?php

$headers =
"From: Cml Admind <assessments@xxxxxxxxxcom> \r\n"
."To: Aaron Bassett <abassett@xxxxxxxxx.com> \r\n"
."Subject: Here's your stuff \r\n"
."Date: Wed, 20 Jun 2001 20:18:47 -0400 \r\n"
."MIME-Version: 1.0 \r\n"
."Content-Type: text/plain; \r\n"
."charset=iso-8859-1 r\n"
."Content-Transfer-Encoding: 7bit \r\n"
."Hello from The Company!";

?>
I notice two things. First the whitespace just before each "\r\n" this could be a problem. Second "Hello from The Company" isn't a header looks like the massage and doesn't belong there.

Posted: Thu Mar 25, 2004 11:04 am
by magicrobotmonkey
Yea but thats where the body goes in mime! Anyways, I eventually got it working with a little script I found in the online docs. But now im trying to send a pdf file. Can anyone point me towards and info about sending pdf through mime? thanks

Posted: Thu Mar 25, 2004 11:05 am
by TheBentinel.com
Yeah, toss in another \r\n after your headers:

Code: Select all

<?php

$headers =
"From: Cml Admind <assessments@xxxxxxxxxcom> \r\n"
."To: Aaron Bassett <abassett@xxxxxxxxx.com> \r\n"
."Subject: Here's your stuff \r\n"
."Date: Wed, 20 Jun 2001 20:18:47 -0400 \r\n"
."MIME-Version: 1.0 \r\n"
."Content-Type: text/plain; \r\n"
."charset=iso-8859-1 r\n"
."Content-Transfer-Encoding: 7bit \r\n"
."\r\n"
."Hello from The Company!";

?>
Give that a whirl.

Posted: Thu Mar 25, 2004 11:06 am
by magicrobotmonkey
oh i see what you mean