Re: Trouble with sending multipart Email



Hi there,

I have exactly the same problem.

I'm using this script:

$to = $address;

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= "To: test <test@xxxxxxxxx>\r\n";

$headers .= "Bcc: Administrator <admin@xxxxxxxxxxx>";

$headers .= "\r\n";
$subject = $subjectline;

$message = $htmlbody;

$headers .= "From: me <me@xxxxx>\r\n";

// Mail it
if(mail($to, $subject, $message, $headers)) $sent = TRUE;
else $sent = FALSE;


Any idea what could be wrong?

What is the boundary for?

I'll try to put the message in the header.

Hope to hear from you.

Thanx in advance.

Fred

"Disco Octopus" <discooctopus@xxxxxxxxx> wrote in message
news:vo0x33sb031d$.174exs2ltcpko.dlg@xxxxxxxxxxxxx
> Hi,
>
> I am having a bit of difficulty when sending mail() with multipart.
>
> Under a Windows server, it is working nicely. I am receiving the email
> message in HTML.
>
> Howver, When I run the code under a Unix server the emails I am receiving
a
> the entire raw message in the message body of my Outlook client.
>
> Here is the PHP that is running....
>
>
>
> if (empty($to)){
> return(false);
> }
>
> if (empty($from)){
> return(false);
> }
>
> $headers = "";
> $headers .= "From: Speed Queen <$from>\r\n";
> $headers .= "MIME-Version: 1.0\r\n";
> $headers .= "To: $toname <$to>\r\n";
> $headers .= "Reply-To: $from\r\n";
> $headers .= "X-Mailer: PHP" . "phpversion()\r\n";
> $headers .= "X-Sender: $from\r\n";
> $headers .= "Return-Path: $from\r\n";
> $headers .= "Content-Type: multipart/alternative;
> boundary=$boundary\r\n\r\n";
>
> //message to people with clients who don't
> //understand MIME
> $headers .= "This is a MIME encoded message\r\n\r\n";
>
> $body = "";
> //plain text version of message
> $body .= "--$boundary\r\n";
> $body .= "Content-Type: text/plain; charset=ISO-8859-1\r\n";
> $body .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
> $body .= $body_plain;
>
> //HTML version of message
> $body .= "--$boundary\r\n";
> $body .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
> $body .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
> $body .= $body_html;
>
> $body .= "\r\n";
>
> return (mail($to, $subject, $body, $headers));
>
>
>
> Can anyone see anyting in here that could be made "nicer" or that would be
> a reason why when run on a different server, different results are seen?
>
> Thanks
>
> --
> a beef jerky site http://www.choicebeefjerky.com.au
> not a beef jerky site http://mycoolwheels.com/vote.cmks
> nobody ever dreams of working for the man


.



Relevant Pages

  • Trouble with sending multipart Email
    ... Under a Windows server, it is working nicely. ... I am receiving the email ... the entire raw message in the message body of my Outlook client. ... not a beef jerky site http://mycoolwheels.com/vote.cmks ...
    (alt.php)
  • RE: SMTP Outgoing - Connection Dropped
    ... Then checked the result of the SMTP diag, ... Checking TCP/UDP SOA serial number using DNS server. ... conversation with the receiving Mail Server computer. ...
    (microsoft.public.windows.server.sbs)
  • Re: Is it possible to trace source of messages bearing Netsky.R or .Q?
    ... using that ip is not a real mail server but has been "trojaned" ... and if it's the ip address of the *receiving* server (ie your ... this is that if a hacker is directing spam ... the reception of viral e-mail ...
    (alt.comp.anti-virus)
  • RE: email from SBS being flagged as SPAM
    ... After you send an email to the receiving domain from company_two.com, ... the receiving server looks for the PTR record for company_two.com. ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: Email Server was down - Actual Problem is below Please help
    ... Because when I updated everyone on Outlook Client from SP1 to SP3 it fixed ... the 2nd card the pc appeared to be working fine I could ping the card ... but I did not realize our branches could not ping this server. ... I am not sure if the Exchange server is truly validating ...
    (microsoft.public.exchange2000.general)