Swiftmailer not sending mail in php -


error_reporting(e_all); require_once 'swift_required.php';  //create transport $transport = swift_smtptransport::newinstance('mail.your_domain.com', 25) ->setusername('name@your_domain.com') ->setpassword('your_password') ;  //create mailer using created transport $mailer = swift_mailer::newinstance($transport);  //create message $message = swift_message::newinstance('php message') ->setfrom(array('name@your_domain.com')) ->setto(array('name@your_domain.com')) ->setbody('php swift mailer sent authentication') ;  //send message $result = $mailer->send($message);    if (!$mailer->send($message, $failures)) { echo "failures:"; print_r($failures); } 

this code used sending email. not working properly. there not error or fail message. wrong?

your code seems work fine if smtp server address valid , reachable credentials provided. perhaps smtp server address or login credentials incorrect or smtp server not running? code ran correctly valid settings.

also, try adding message upon success know code sent out email - otherwise might not notice it's working if emails spam-filtered @ destination:

if (!$mailer->send($message, $failures)) {   echo "failures:";   print_r($failures); } else {     echo 'email sent successfully'; } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -