My Case: web application that need to send 1,000 messages per day to main gmail account.
(Only need to send email, not need receive emails - email client)
1. option - use php mail function + sendmail + config php.ini
php example:
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
php.ini config (ubuntu):
sendmail_path = /usr/sbin/sendmail -t -i
pros:don't need email account, easy to setup
cons:?
2. option - use Zend_Mail + transport on smpt+ password auto php example(need include Zend_Mail classes):
$config = array('auth' => 'login',
'username' => 'myusername',
'password' => 'password');
$transport = new Zend_Mail_Transport_Smtp('mail.server.com', $config);
$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('sender@test.com', 'Some Sender');
$mail->addTo('recipient@test.com', 'Some Recipient');
$mail->setSubject('TestSubject');
$mail->send($transport);
pros:?
cons:?
Questions:
Can 1 option be filtered by gmail email server as spam?
please can you add pros + cons to options above
Thanks