Send email using gmail smtp in zend? [duplicate] - php

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
email zend framwork smtp
I have following configuration:
smtp.type = Zend_Mail_Transport_Smtp
smtp.smtpServer = "smtp.gmail.com"
smtp.username = "ddd#gmail.com"
smtp.password = "dddd"
smtp.email = "ddd#gmail.com"
smtp.port = "587"
smtp.ssl = "tls"
smtp.auth = "login"
I am getting following error:
5.7.0 Must issue a STARTTLS command first. 74sm813723wem.41
My COde:
public function sendEmail( $mailData, $bootstrap = null ) {
// Get SMTP server configurations
if ( $bootstrap == null ) {
$front = Zend_Controller_Front::getInstance();
$bootstrap = $front->getParam('bootstrap');
}
$smtpSettings = $bootstrap->getOption('smtp');
print_r($smtpSettings);
// Only pass username password settings if the authentication is required.
if ( $smtpSettings['auth'] == 'login' ) {
$config = array('ssl' => $smtpSettings['ssl'],
'username' => $smtpSettings['username'],
'password' => $smtpSettings['password']);
$transport = new Zend_Mail_Transport_Smtp( $smtpSettings['smtpServer'], $config );
} else {
$transport = new Zend_Mail_Transport_Smtp( $smtpSettings['smtpServer'] );
}
$mail = new Zend_Mail( 'utf-8' );
try {
if ( $mailData['user'] == true ) {
$mail->setFrom( $mailData['from'], $mailData['fromName'] );
} else {
$mail->setFrom( $smtpSettings['email'], "eCHDP" );
}
// Do we have a single reciepent or multiple receipents?
if ( !is_array($mailData['to']) ) {
$mail->addTo( $mailData['to'] , $mailData['toName'] );
} else {
// We have multiple receipents. Add all of them.
foreach ( $mailData['to'] as $id => $value ) {
$mail->addTo( $value , $mailData['toName'][$id] );
}
}
$mail->setSubject( $mailData['subject'] );
$mail->setBodyHtml( $mailData['body'] );
// If attachment found then attach
if ( $mailData['attachment'] ) {
$attach = new Zend_Mime_Part( file_get_contents( $mailData['attachment'] ) );
$attach->type = 'application/pdf';
$attach->disposition = Zend_Mime::DISPOSITION_ATTACHMENT;
$attach->filename = 'Invoice.pdf';
$mail->addAttachment( $attach );
}
$mail->send( $transport );
return true;
} catch ( Exception $e ) {
echo "Error sending Email : ";
$logger = Zend_Registry::get('Logger');
$logger->err($e->getMessage());
echo $e->getMessage() . "\n\n\n";
return false;
}
}
Can someone guess that what is the error ? I can post code as well if required.
Thanks

This is from our application.ini
resources.mail.transport.type = Zend_Mail_Transport_Smtp
resources.mail.transport.host = "smtp.gmail.com"
resources.mail.transport.port = 587
resources.mail.transport.auth = "login"
resources.mail.transport.username = "email#address.com"
resources.mail.transport.password = "password"
resources.mail.transport.ssl = "tls"
And it "Just works (tm)"!

You can try with: ssl = tls or port = 587

Related

how to use dreamscape api in nodejs for check domain name

I have already work this in php. Here is my working code:
$request = array(
'DomainNames' => $domain_names
);
$response = dreamScapeAPI('DomainCheck', $request);
$available = false;
$alt_domains = array(); // Alternative to user's expected domain names
if (!is_soap_fault($response)) {
// Successfully checked the availability of the domains
if (isset($response->APIResponse->AvailabilityList)) {
$availabilityList = $response->APIResponse->AvailabilityList;
foreach ($availabilityList as $list) {
if ($list->Available){
if ($domain == $list->Item) {
$available = true; // user prefered domain found
}
else {
$alt_domains[] = $list->Item;
}
}
}
}
else {
$error = $response->APIResponse->Errors;
foreach ($error as $e) {
$api_error = $e->Message;
//echo $e->Item . ' - ' . $e->Message . '<br />';
}
}
}
function dreamScapeAPI($method, $data = null) {
$reseller_api_soap_client = "";
$soap_location = 'http://soap.secureapi.com.au/API-2.1';
$wsdl_location = 'http://soap.secureapi.com.au/wsdl/API-2.1.wsdl';
$authenticate = array();
$authenticate['AuthenticateRequest'] = array();
$authenticate['AuthenticateRequest']['ResellerID'] = '**';
$authenticate['AuthenticateRequest']['APIKey'] = '**';
//convert $authenticate to a soap variable
$authenticate['AuthenticateRequest'] = new SoapVar($authenticate['AuthenticateRequest'], SOAP_ENC_OBJECT);
$authenticate = new SoapVar($authenticate, SOAP_ENC_OBJECT);
$header = new SoapHeader($soap_location, 'Authenticate', $authenticate, false);
$reseller_api_soap_client = new SoapClient($wsdl_location, array('soap_version' => SOAP_1_2, 'cache_wsdl' => WSDL_CACHE_NONE));
$reseller_api_soap_client->__setSoapHeaders(array($header));
$prepared_data = $data != null ? array($data) : array();
try {
$response = $reseller_api_soap_client->__soapCall($method, $prepared_data);
} catch (SoapFault $response) { }
return $response;
}
I tried with this : https://github.com/dan-power/node-dreamscape
But domain search can not work properly. Mainly, I want it on nodejs using nodejs dreamscape api but this method is not available on nodejs.
Here is my working demo: click here

form doesn't get sent with PHPMailer()

can someone help me a bit with PhpMailer form? I'm not a php dev and i'm a bit lost, mostly because I have no idea how to debug it.
Tips how to debug such scripts are very welcome! (I don't know how to do it in localhost and I host it in a web shared host so I cannot ssh the server)
This is the script:
I have a multiple step form from Frontend which has also recaptcha, so the script include validation of different form steps and recaptcha validation.
<?php
require_once("/PHPMailer/PHPMailer.php");
use PHPMailer\PHPMailer\PHPMailer;
$t_mailer = new PHPMailer;
$t_mailer->SMTPAuth = true;
$t_mailer->Username = "myemail#gmail.com"; // gmail username
$t_mailer->Password = "****"; //gmail password
$t_mailer->SMTPSecure = 'tls';
$t_mailer->Port = 587;
$t_mailer->setFrom("myemail#gmail.com", "Name for the owner of the Account");
//$t_mailer->addAddress("myemail#gmail.com", "Name for who is being sent the email.");
$t_mailer->Subject = "Project request from ECA";
$t_mailer->Body = "This will be the message body that is sent.";
// $recipient = 'myemail#gmail.com'; // Enter the recipient's email address here.
// $subject = 'Project request from ECA'; // Enter the subject of the email here.
$success = 'Your message was sent successful. Thanks.';
$error = 'Sorry. We were unable to send your message.';
$invalid = 'Validation errors occurred. Please confirm the fields and submit it again.';
if ( ! empty( $_POST ) ) {
require_once('recaptcha.php');
if( isset( $_POST['email'] ) ) {
$from = filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL );
} else {
$from = null;
}
if( isset( $_POST['step'] ) ) {
$step = $_POST['step'];
} else {
$step = 'send';
}
if ( ! empty( $_POST['reCAPTCHA'] ) ) {
if ( ! empty( $reCAPTCHA['success'] ) ) {
$errCaptcha = '';
} else {
$errCaptcha = true;
}
} else {
$errCaptcha = '';
}
$errFields = array();
foreach( $_POST as $key => $value ) {
if ( $key != 'section' && $key != 'reCAPTCHA' ) {
if ( $key == 'email' ) {
$validation = filter_var( $_POST[$key], FILTER_VALIDATE_EMAIL );
} else {
$validation = ! empty( $_POST[$key] );
}
if ( ! $validation ) {
$errFields[$key] = true;
}
}
}
if ( empty( $errCaptcha ) && count( $errFields ) === 0 && $step === 'send' ) {
$header = "From: " . $from . " <" . $from . ">" . "\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$body = '<table style="padding: 35px; background-color: #f5f5f5"; font-family: Roboto, sans-serif; font-size: 1rem; text-align: left; border-radius: 4px>';
$body .= '<tr><th style="font-size: 1.5rem; font-weight: 600; color: #1E50BC">'.$subject.'</th></tr>';
$body .= '<tr></td>';
foreach( $_POST as $key => $value ) {
if ( $key != 'section' && $key != 'reCAPTCHA' ) {
$body .= '<p><b>' . str_replace( '-', ' ', ucfirst( $key ) ) . '</b>: ' . $value . '</p>';
}
}
$body .= '</td></tr>';
$body .= '</table>';
$t_mailer->Body = $body;
$t_mailer->addAddress($from, 'who send the email');
// $mail = mail( $recipient, $subject, $body, $header );
// $mail
if ( $t_mailer->send() ) {
$response = array(
'status' => 'success',
'info' => $success
);
print_r( json_encode( $response ) );
} else {
$response = array(
'status' => 'fail',
'info' => $error
);
print_r( json_encode( $response ) );
}
} else {
$response = array(
'status' => 'invalid',
'info' => $invalid,
'captcha' => $errCaptcha,
'fields' => $errFields,
'errors' => count( $errFields )
);
print_r( json_encode( $response ) );
}
exit;
}
I'm sure PhpMailer works with my host and my server because I tried a very simple script that send an email from root and it worked. (I got the email in my gmail inbox)
But This script is in another folder, not root, even tho they all have same folder/files permission (not sure if is relevant, but better specify!)
Several things not quite right here.
When you're using PHPMailer without composer, you need to load all the classes it needs yourself, so add:
require_once '/PHPMailer/SMTP.php';
require_once '/PHPMailer/Exception.php';
You are setting some SMTP config properties, but not actually telling PHPMailer to use SMTP, so add this:
$t_mailer->isSMTP();
You're sending from a gmail address, which means you must send through gmail's servers (or you will fail SPF checks), but you have not specified a server to send through, so set this:
$t_mailer->Host = 'smtp.gmail.com';
Your content is in HTML, but you're not asking PHPMailer to send it as HTML:
$t_mailer->isHTML();
You don't need any of that stuff you're doing with $header; PHPMailer does all that for you.
Rather than going any further, I'd recommend basing your code on the gmail example provided with PHPMailer, and if you run into any other issues, refer to the PHPMailer troubleshooting guide and search on here.

PHP email validation script

My first post here, although i have used this site many times to find fixes for code.
I've been using a script to validate emails on my old host which works fine, the new host however (123-reg) it doesnt validate them correctly at all.
This script actually verifies the existence of an email not just the format of it.
please see the following links
t43.co.uk/emailcheck.php?email=asdasdasd#hotmail.com (works fine)
smile-database.co.uk/emailcheck.php?email=asdasdasd#hotmail.com (always says valid when i know it isnt)
my script is below.
function checkEmail( $email, $chFail = false )
{
$msgs = Array();
$msgs[] = 'Received email address: '.$email;
if( !preg_match( "/^(([^<>()[\]\\\\.,;:\s#\"]+(\.[^<>()[\]\\\\.,;:\s#\"]+)*)|(\"([^\"\\\\\r]|(\\\\[\w\W]))*\"))#((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])|(([a-z\-0-9áàäçéèêñóòôöüæøå]+\.)+[a-z]{2,}))$/i", $email ) )
{
$msgs[] = 'Email address was not recognised as a valid email pattern<br><br>';
return $chFail ? Array( false, $msgs ) : false;
}
$msgs[] = 'Email address was recognised as a valid email pattern';
//get the mx host name
if( preg_match( "/#\[[\d.]*\]$/", $email ) )
{
$mxHost[0] = preg_replace( "/[\w\W]*#\[([\d.]+)\]$/", "$1", $email );
$msgs[] = 'Email address contained IP address '.$mxHost[0].' - no need for MX lookup';
}
else
{
//get all mx servers - if no MX records, assume domain is MX (SMTP RFC)
$domain = preg_replace( "/^[\w\W]*#([^#]*)$/i", "$1", $email );
if( !getmxrr( $domain, $mxHost, $weightings ) )
{
$mxHost[0] = $domain;
$msgs[] = 'Failed to obtain MX records, defaulting to '.$domain.' as specified by SMTP protocol';
}
else
{
array_multisort( $weightings, $mxHost );
$cnt = ''; $co = 0; foreach( $mxHost as $ch ) { $cnt .= ( $cnt ? ', ' : '' ) . $ch . ' (' . $weightings[$co] . ')'; $co++; }
$msgs[] = 'Obtained the following MX records for '.$domain.': '.$cnt;
}
}
//check each server until you are given permission to connect, then check only that one server
foreach( $mxHost as $currentHost )
{
$msgs[] = 'Checking MX server: '.$currentHost;
if( $connection = #fsockopen( $currentHost, 25 ) )
{
$msgs[] = 'Created socket ('.$connection.') to '.$currentHost;
if( preg_match( "/^2\d\d/", $cn = fgets( $connection, 1024 ) ) )
{
$msgs[] = $currentHost.' sent SMTP connection header - no futher MX servers will be checked: '.$cn;
while( preg_match( "/^2\d\d-/", $cn ) )
{
$cn = fgets( $connection, 1024 );
$msgs[] = $currentHost.' sent extra connection header: '.$cn;
}
if( !$_SERVER )
{
global $HTTP_SERVER_VARS; $_SERVER = $HTTP_SERVER_VARS;
}
//attempt to send an email from the user to themselves (not <> as some misconfigured servers reject it)
echo $_SERVER['HTTP_HOST'] . "<BR>";
$localHostIP = gethostbyname(preg_replace("/^.*#|:.*$/",'',$_SERVER['HTTP_HOST']));
echo $localHostIP . "<BR>";
$localHostName = gethostbyaddr($localHostIP);
fputs( $connection, 'HELO '.($localHostName?$localHostName:('['.$localHostIP.']'))."\r\n" );
if( $success = preg_match( "/^2\d\d/", $hl = fgets( $connection, 1024 ) ) )
{
$msgs[] = $currentHost.' sent HELO response: '.$hl;
fputs( $connection, "MAIL FROM: <$email>\r\n" );
if( $success = preg_match( "/^2\d\d/", $from = fgets( $connection, 1024 ) ) )
{
$msgs[] = $currentHost.' sent MAIL FROM response: '.$from;
fputs( $connection, "RCPT TO: <$email>\r\n" );
if( $success = preg_match( "/^2\d\d/", $to = fgets( $connection, 1024 ) ) )
{
$msgs[] = $currentHost.' sent RCPT TO response: '.$to;
}
else
{
$msgs[] = $currentHost.' rejected recipient: '.$to;
}
}
else
{
$msgs[] = $currentHost.' rejected MAIL FROM: '.$from;
}
}
else
{
$msgs[] = $currentHost.' rejected HELO: '.$hl;
}
fputs( $connection, "QUIT\r\n");
fgets( $connection, 1024 ); fclose( $connection );
//see if the transaction was permitted (i.e. does that email address exist)
$msgs[] = $success ? ('Email address was accepted by '.$currentHost) : ('Email address was rejected by '.$currentHost);
return $chFail ? Array( $success, $msgs ) : $success;
}
elseif ( preg_match( "/^550/", $cn ) )
{
$msgs[] = 'Mail domain denies connections from this host - no futher MX servers will be checked: '.$cn;
return $chFail ? Array( false, $msgs ) : false;
}
else
{
$msgs[] = $currentHost.' did not send SMTP connection header: '.$cn;
}
}
else
{
$msgs[] = 'Failed to create socket to '.$currentHost;
}
}
$msgs[] = 'Could not establish SMTP session with any MX servers';
return $chFail ? Array( false, $msgs ) : false;
}
echo "<br><br>Email Validation Check<br><br>";
$return_msgs = checkEmail( $_REQUEST['email'], true );
if ( $return_msgs[0] == 0 )
{
echo "<img src='img/Fail.png'> May be invalid<br>".$_REQUEST['email'];
}
elseif ( $return_msgs[0] == 1 )
{
echo "<img src='img/OK.png'> Valid<br>".$_REQUEST['email'];
}
else
{
echo "<img src='img/Caution.png'> Caution<br>".$_REQUEST['email'];
}
I have read one great topic about email validation.
Author propose to use this regexp: /.+#.+\..+/i and give a great description (in Russian) to a lot of "why exactly this regexp"
'somestring' # 'somestring'.'somestring'

CakePHP- Accessing mail using IMAP

Re-visiting this problem specified in my previous question, I tried and tried, also with different accounts (I tried gmail, as well as outlook), but the problem still persists. The error I get is the following if I try to access my google account
Error: Unable to get imap_thread after 4 retries. 'Can't open mailbox {imap.gmail.com:993/ssl/imap/tls/novalidate-cert}INBOX: invalid remote specification'
if I try accessing email on my outlook account, the error is the same :
Error: Unable to get imap_thread after 4 retries. 'Can't open mailbox {outlook.office365.com:993/ssl/imap/tls/novalidate-cert}INBOX: invalid remote specification'
My setup is as follows :
public $emailTicket = array(
'datasource' => 'ImapSource',
'server' => 'outlook.office365.com',
'connect' => 'imap/tls/novalidate-cert',
'username' => 'my email here',
'password' => 'my password here',
'port' => '993', //incoming port
'ssl' => true,
'encoding' => 'UTF-8',
'error_handler' => 'php',
'auto_mark_as' => array(
'Seen',
// 'Answered',
// 'Flagged',
// 'Deleted',
// 'Draft',
),
);
I am working on a local machine, does anyone know if this might be the problem or not? Has anyone ever tried this and worked for him/her? I am open to all input!
I can't seem to find what's wrong here, I've been at this for about 2days now, so if anyone can help, I appreciate it!
Also here's the link for the plugin i'm using, by Nicolas Ramy..
You can use the following implemented code to fulfill your requirements:
public function generate_email_response_pdf()
{
$this->layout = false;
$this->autoRender = false;
$username = EMP_SMTP_MAIL_FROM;
$password = EMP_SMTP_MAIL_PASSWORD;
$imap = imap_open('{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX', $username, $password);
$emails = imap_search($imap, 'ALL');
if(!empty($emails))
{
//put the newest emails on top
rsort($emails);
foreach($emails as $email_number)
{
$flag = 0;
$mail_data = array();
$file_name = array();
$output = array();
$savefilename = null;
$filename = null;
$overview = imap_fetch_overview($imap, $email_number, 0);
//initialize the subject index with -000, considering not receving this will not be received in
//subject line of email
$output['subject'] = '-000x';
if(isset($overview[0] -> subject))
{
$output['subject'] = $overview[0] -> subject;
}
$structure = imap_fetchstructure($imap, $email_number);
if(property_exists($structure, 'parts'))
{
$flag = 1;
$flattened_parts = $this->flatten_parts($structure->parts);
foreach($flattened_parts as $part_number => $part)
{
switch($part->type)
{
case 0:
//the HTML or plain text part of the email
if((isset($part->subtype)=='HTML')&&(isset($part->disposition)=='ATTACHMENT'))
{
$part_number = 1.2;
}
else if(isset($part->subtype)=='HTML')
{
$part_number = $part_number;
}
else
{
$part_number = $part_number;
}
$message = $this->get_part($imap, $email_number, $part_number, $part->encoding);
//now do something with the message, e.g. render it
break;
case 1:
// multi-part headers, can ignore
break;
case 2:
// attached message headers, can ignore
break;
case 3: // application
case 4: // audio
case 5: // image
case 6: // video
case 7: // other
break;
}
if(isset($part->disposition))
{
$filename = $this->get_filename_from_part($part);
if($filename)
{
// it's an attachment
$attachment = $this->get_part($imap, $email_number, $part_number, $part->encoding);
$file_info = pathinfo($filename);
$savefilename = RESPONSE_ATTACHMENT_PREFIX.$file_info['filename'].'_'.$this->_getRandId(4).'.'.$file_info['extension'];
$file_name[] = $savefilename;
$attachment_file_name = $this->save_attachment($attachment, $savefilename, $directory_path);
//imap_fetchbody($imap, $email_number, 2); //This marks message as read
}
else
{
// don't know what it is
}
}
}
}
else
{
$encoding = $structure->encoding;
$message = imap_fetchbody($imap, $email_number, 1.2);
//echo $message; die;
if($message == "")
{
$message = imap_body($imap, $email_number);
if($encoding == 3)
{
$message = base64_decode($message);
}
else if($encoding == 4)
{
$message = quoted_printable_decode($message);
}
}
}
$header = imap_headerinfo($imap, $email_number);
$from_email = $header->from[0]->mailbox."#".$header->from[0]->host;
$to_email = $header->to[0]->mailbox."#".$header->to[0]->host;
$reply_to_email = $header->reply_to[0]->mailbox."#".$header->reply_to[0]->host;
$cc_email = array();
if(isset($header->cc))
{
foreach($header->cc as $ccmail)
{
$cc_email[] = $ccmail->mailbox.'#'.$ccmail->host;
}
$cc_email = implode(", ", $cc_email);
}
$output['to'] = $to_email;
$output['from'] = $from_email;
$output['reply_to'] = $reply_to_email;
$output['cc'] = $cc_email;
$formatted_date = date('D, d M Y h:i A', strtotime($overview[0] -> date));
$output['date'] = $formatted_date;
$output['message'] = $message;
$output['flag'] = $flag;
$mail_data['Attachment'] = $file_name;
$mail_data['Data'] = $output;
$this->set('response_data', $mail_data);
$mail_content = null;
if(!empty($mail_data))
{
$this->viewPath = 'Elements/default';
$mail_content = $this->render('pdf_content');
}
$header = null;
$footer = null;
$html = preg_replace(array('/[^\r\n\t\x20-\x7E\xA0-\xFF]*/'), '', $mail_content);
$pdfFile = $this->_generateWkPdf($html, $directory_path, $new_file_name, $header, $footer);
$image_type = EXT_JPG;
$response_files_array = $this->_generateImagesFromPdf($directory_path.$pdfFile, $directory_path, $new_file_name, $image_type);
}
}
imap_close($imap);
}

Why mail sent ends up in Junkbox when we use variable value?

Hi Please let me know what is wrong in my code
Mail Always send in JunkBox when condition in if not else
$comObj = new companies();
$companyData = $comObj->getCompanyDataPDF ( $params );
$companyData[0]['term_condition'] = nl2br($companyData[0]['term_condition']);
$proposalData = $objProposal->getSavedData ( $id );
$mergeData = array_merge ( array ('companyData' => $companyData ), array ('proposalData' => $proposalData ) );
$htmlcontent = $this->view->partial("companyapi/pdf.phtml", $mergeData);
require_once('html2fpdf/html2pdf.class.php');
$name_of_pdf = trim($proposalData[0]['proposal_name']).'pdf_'.time().'.pdf';
$pdf = new HTML2PDF('P', 'A4', 'fr');
$pdf->WriteHTML($htmlcontent);
$new_pdf= $pdf->Output('', 'S');
$filepath= PUBLIC_PATH.'tempPdf/'.$name_of_pdf;
$rootpathforcheckfile = IMG_HARD_DRIVE_PATH.'tempPdf/'.$name_of_pdf;
$temp_array = array();
$temp_array["pdf"] = $new_pdf;
$temp_array["pdf_name"] = $name_of_pdf;
$customername="Customer";
$companyname="";
if($params ['customerName']){
$customername=$params ['customerName'];
}
if($companyData[0]['name']){
$companyname=$companyData[0]['name'];
}
if(isset($proposalData[0]['proposal_name']) && $proposalData[0]['proposal_name'] != ''){
$subject = (string)strtoupper($proposalData[0]['proposal_name']);
}else {
$subject = "Proposal Mail";
}
$sndemail =Email_Mailer::sendMail($subject,'Please find attached proposal',$customername,$params ['custEmail'],$temp_array,$companyname,$companyData[0]['email']);
My mail function :::
public static function sendMail($subject,$message,$recipentname='',$recipentemail,$filesPathArray,$sendername='',$senderemail)
{
try
{
$mail = new Zend_Mail();
$mail->setBodyHtml($formated_msg);
$mail->setFrom($senderemail);
$mail->addTo($recipentemail,$recipentname);
$mail->addCc($senderemail,$sendername);
$mail->setSubject($subject);
//attachments code
if( !empty($filesPathArray) )
{
$at = new Zend_Mime_Part($filesPathArray["pdf"]);
$at->type = 'pdf';
$at->filename = $filesPathArray["pdf_name"];
$at->disposition = Zend_Mime::DISPOSITION_INLINE;
$at->encoding = Zend_Mime::ENCODING_BASE64;
$mail->addAttachment($at);
} else {
}
$mail->send();
return true;
}
catch (Zend_Mail_Transport_Exception $e)
{
//throw $e;
return false;
}
catch (Zend_Mail_Protocol_Exception $e)
{
//throw $e;
return false;
}
catch (Zend_Exception $e)
{
//throw $e;
return false;
}
}
Thanks
Presumably the mail system you are sending to is flagging the mail as spam. You should investigate this there, and possibly re-ask this question on serverfault.
Given the general generic-ness of the message, I'm not altogether suprised. Either work on making the mail details clearer on what it contains (so it doesn't trigger the filters) or look at something like dkim to prove who you are so it is no longer flagged.

Categories