I\'m trying to send an e-mail with ZendMail ( this simple script sums it up )
se
Also if you want to seand mail in magento with attachment have a look on the following snippet
$config = array(
'ssl' => 'tls',
'auth' => 'login',
'username' => 'hassanalishahzad@gmail.com',
'password' => 'yourPassword'
);
$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
$bodytext = "Please see attachment for customers detail.";
$mail = new Zend_Mail();
$mail->setFrom('noreply@yourdomain.com','Hassan');
$mail->addTo('xyz@yourdomain.com' );
$mail->setSubject('Customers info');
$mail->setBodyText($bodytext);
$file = $mail->createAttachment(file_get_contents($path.$fileName));
$file ->type = 'text/csv';
$file ->disposition = Zend_Mime::DISPOSITION_INLINE;
$file ->encoding = Zend_Mime::ENCODING_BASE64;
$file ->filename = $fileName;
if(!$mail->send($transport)) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
echo "File Completed";exit;
}