Code Search for Developers
 
 
  

smtp_authentication.php from Astrum Futura at Krugle


Show smtp_authentication.php syntax highlighted

<?php

require('../../Swift.php');
require('../../Swift/Connection/SMTP.php');

$mailer = new Swift(new Swift_Connection_SMTP('mail.theagentlist.com', SWIFT_SECURE_PORT, SWIFT_TLS));

//If anything goes wrong you can see what happened in the logs
if ($mailer->isConnected()) //Optional
{
	//You can call authenticate() anywhere before calling send()
	if ($mailer->authenticate('info', 'jaycarey'))
	{
		//Sends a simple email
		$mailer->send(
			'"Joe Bloggs" <joe@bloggs.com>',
			'"Your name" <you@yourdomain.com>',
			'Some Subject',
			"Hello Joe it's only me!"
		);
	}
	else echo "Didn't authenticate to server";
	
	//Closes cleanly... works without this but it's not as polite.
	$mailer->close();
}
else echo "The mailer failed to connect. Errors: <pre>".print_r($mailer->errors, 1)."</pre><br />
	Log: <pre>".print_r($mailer->transactions, 1)."</pre>";

print_r($mailer->transactions);

?>




See more files for this project here

Astrum Futura

Multiplayer space strategy game written in PHP5 with the Zend Framework. User interface uses Javascript/AJAX for dynamic interaction. Players compete across a hexagonal map of 10,000 sectors, planets, stars and other locations through trade and combat.

Project homepage: http://sourceforge.net/projects/astrumfutura
Programming language(s): PHP,XML
License: other

  attachment_smtp.php
  basic_sendmail.php
  basic_smtp.php
  basic_smtp_multipart.php
  batch_smtp_multipart.php
  cc_smtp.php
  embedded_image.php
  loading_plugin.php
  native_mail.php
  rotating_connections.php
  smtp_authentication.php
  smtp_ssl.php
  smtp_tls_gmail.php