Hey all,
I'm writing a free sms script in php for a client of mine. My cell carrier provides a free email to sms gateway, so I'm using php to send emails to the gateway so they're forwarded to the recipients cellphone. However, I keep receiving a bounce back email from the gateway saying:
----- The following addresses had permanent fatal errors -----
<5926184449@sms.cellinkgy.com>
(reason: 552 email size is too long)
----- Transcript of session follows -----
... while talking to [172.20.20.34]:
DATA
<<< 552 email size is too long
554 5.0.0 Service unavailable
My message contains two characters, and the only header information I input, is the FROM header information. In addition to this, if I use my webmail interface from my hosting, and send an email to the gateway, it works fine, and emails sent from the webmail interface have more header information than emails sent from my php script.
This is my script:
<?php
include('Mail.php');
$recipients = '5926184449@sms.cellinkgy.com ';
/*
$headers['Content-Disposition'] = 'inline';
$headers['Content-Transfer-Encoding'] = 'quoted-printable';
$headers['Content-Type'] = ' text/plain; charset="iso-8859-1"';
$headers['MIME-Version'] = '1.0';
$headers['To'] = ' 5926184449@sms.cellinkgy.com';
$headers['Subject'] = 'test';
$headers['Reply-To'] = 'chad@sunatrise.com';
*/
$headers['From'] = '<chad@sunatrise.com>';
$body = 'Test message';
$smtpinfo["host"] = "mail.sunatrise.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "xxxx@sunatrise.com";
$smtpinfo["password"] = "xxxxxx";
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory('smtp', $smtpinfo);
$send = $mail_object->send($recipients, $headers, $body);
if (PEAR::isError($send)) {
print($send->getMessage());
}
else
{
echo "Message Sent!";
}
?>
Any help is greatly appreciated!
-Chad.