I'm trying to send an html newsletter and having used an excellent windows mailing program called groupmail, for many years, I want to fire them off from our database (FileMaker), using PHP.
I have php 4.3.10 on windows 2000, apache 1.3.33
In php.ini I've set...
Code: Select all
їmail function]
; For Win32 only.
SMTP = smtp.myisp.net
smtp_port = 25
; For Win32 only.
sendmail_from = administrator@mydomain.comhttp://www.daniweb.com/techtalkforums/thread2959.html
Code: Select all
<?php
$boundary = "nextPart";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: Me <sales@mysite.com>\r\n";
$headers .= "Content-Type: multipart/alternative; boundary = $boundary\r\n";
//text version
$headers .= "\n--$boundary\n"; // beginning \n added to separate previous content
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "This is the plain version";
//html version
$headers .= "\n--$boundary\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "This is the <b>HTML</b> version";
$mailcommand = mail("batfastad@nowhere.net", "subject line", "", $headers);
if (!$mailcommand) {
// E-MAIL NOT SENT
echo ("mail not sent");
} else {
// E-MAIL SENT SUCCESSFULLY
echo ("sent!!!");
}
?>I read that in php under windows the headers in the mail() function can only have a maximum size of 4096 bytes.
Obviously that's not ideal if I'm trying to send the body in the headers.
Is this true? Could this be causing my problem?
Is there a way to do this without sending the message body in the headers?
Also what do I do about the multipart boundary ($boundary above)?
Can it be anything so long as it's unique?
So some kind of timestamp with random characters should work, rather than $boundary = "nextpart"
Does anyone know why this isn't working??
I've read through some information at http://www.phpbuilder.com/columns/kartic20000807.php3 but i found it a bit heavy going.
Please help!!
Thanks guys
Ben