aint working with this script

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
romeo_16
Forum Newbie
Posts: 1
Joined: Mon Jun 15, 2009 12:34 am

aint working with this script

Post by romeo_16 »

Hi All,

Please help, i can't figure it out what is wrong in sending mail in swift mailer, with this script, there is no error at all and send anything.

Code: Select all

 
<? 
 require_once "functions/Swift.php";
 require_once "functions/Swift/Connection/SMTP.php";
  
  $smtp->setUsername('emr.notifier@emr.ph');
  $smtp->setPassword('*********');
  
 //Create a Swift instance and connect to Gmail (PHP5)
  $swift = new Swift(new Swift_Connection_SMTP("smtp.gmail.com", Swift_Connection_SMTP::PORT_SECURE, Swift_Connection_SMTP::ENC_TLS));
  
  $message = "hi";
  $email = "nelmar_18@yahoo.com";
  
 //Try sending the email
  $sent = $swift->send($message, $email, "Sender name");
  
  //Disconnect from SMTP, we're done
  $swift->disconnect(); 
  ?>
 
Thanks,
Last edited by Benjamin on Mon Jun 15, 2009 10:32 am, edited 1 time in total.
Reason: Added [code=php] tags.
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

Re: aint working with this script

Post by omniuni »

I suspect the server is not configured correctly. Try sending something with PHP's basic mail() function, and see if that works. If not, see if you get an error. If it does not get an error, and does not work, contact your host.
Post Reply