I have this php code that allows me to send emails, but I can only get it to send emails to my email account on my host server (admin@ciudanossinfronteras.com). If I change the “->setTo” to any other email address I have, the email does not send. (The page goes blank like it should but I never get the email).
Can anyone help me and tell me why this is happening?
code:
<?php
require_once 'lib/swift_required.php';
//Create the Transport
$transport = Swift_SmtpTransport::newInstance('mail.ciudanossinfronteras.com', 26)
->setUsername('admin@ciudadanossinfronteras.com')
->setPassword('******')
;
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
//Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('duke2kill@hotmail.com' => 'Adam schroeder'))
->setTo(array('admin@ciudanossinfronteras.com', 'other@domain.org' => 'Ben'))
->setBody('This is what I said yesterday:bla bla bla')
;
//Send the message
$result = $mailer->send($message);
?>