I am facing an issue where in, i am not able to send emails if the email body has more than 70 chars! The site is hosted on godaddy.
SMTP host : relay-hosting.secureserver.net
SMTP port : 25
For message body < 70 chars i get a SMTP reply code of 250 as expected. But anything > 70 gives a reply code 451 which means "Requested action aborted: local error in processing" and am not able to figure out why! =(
I am using this SMTP class with which i have been able to send mails from godaddy earlier (with a different SMTP credentials)
/**
* Wrapper function for SMTP class
*/
function sendEmail($to, $from, $subject, $message ,$ishtml = null, $headers = null)
{
global $_CONFIG;
$smtp = new SMTP($_CONFIG['email_host'], $_CONFIG['email_port'], false, 5);
if($ishtml)
{
$smtp->set_html();
}
$extraHeader = null;
if(is_array($headers))
{
$extraHeader = array(
'CC' => $headers['CC'],
'BCC'=> $headers['BCC']
);
}
else
{
$headers = null;
}
# Who is this email from? (MAIL FROM header)
$smtp->mail_from($from);
# Sending the email
$isSent = $smtp->send($to, $subject, $message, $ishtml, $extraHeader);
//var_dump($smtp->error());exit;
return $isSent;
}
Function call:
$subject = "Thanks you for registering";
$from = '[email protected]';
$to = $regFormData['email'];
$message = "Thanks you for registering.You have registered with the following details";
$sendStatus = sendEmail($to, $from, $subject, $message ,false, $headers);
//$sendStatus returns false and SMTP relay code is 451
The SMTP relay is avaliable for all godaddy hostings. Could it be that they have some kind of restriction?
Any inputs are appreciated! Thanks.
--Just received a reply from godaddy support. "We do not place any restriction on your email message character length, and it is possible that the problem is due to something in the code."