[SOLVED] php.ini setting for swift mailer

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
cade
Forum Commoner
Posts: 55
Joined: Tue Jul 03, 2007 8:18 pm

[SOLVED] php.ini setting for swift mailer

Post by cade »

hi all...

I'm having a problem where i send an email using swift mailer, it does not show any error. I used Post cast server on my development PC to monitor the email....Is there any configuration in php.ini setting that I need to set?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You are "having a problem?" What is the problem?
cade
Forum Commoner
Posts: 55
Joined: Tue Jul 03, 2007 8:18 pm

Post by cade »

Code: Select all

require_once "lib/Swift.php";
require_once "lib/Swift/Connection/NativeMail.php";
$swift =& new Swift(new Swift_Connection_NativeMail());
$recipients =& new Swift_RecipientList();
$message =& new Swift_Message('Welcome to....');

$msg2 = "Dear ".$name.", <br>
        Congratulations on your recent appointment and welcome to
		dareda.com. You have now been added to dareda's online HR solution. 
		Click on the following link to confirm and activate 
		you as a user of dareda. <br><br>
		<a href=\"".$url."\">".$url."</a>
		<br><br>Sincerely<br>dareda";
$msg = "Dear ".$name.", \n
        Congratulations on your recent appointment and welcome to
		dareda.com. You have now been added to dareda's online HR solution. 
		Click on the following link to confirm and activate
		you as a user of dareda. \n\n
		<a href=\"".$url."\">".$url."</a>
		\n\nSincerely\ndareda";

$recipients->addTo($email, $name);
$message->attach(new Swift_Message_Part($msg2));
$message->attach(new Swift_Message_Part($msg, "text/html"));
$swift->batchSend($message, $recipients, new Swift_Address("vmteam@dareda.com", "dareda.com"));
this is the sample code of my php and swift mailer
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

And, again, what is the problem?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Swift_Connection_NativeMail uses the same settings mail() does. The manual page on mail() references the directives.
cade
Forum Commoner
Posts: 55
Joined: Tue Jul 03, 2007 8:18 pm

Post by cade »

the problem is why don't recipient does not receive the email...
cade
Forum Commoner
Posts: 55
Joined: Tue Jul 03, 2007 8:18 pm

Post by cade »

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 <kelamkabut@example.com>... we do not relay <webmaster@virtualmalaysia.com> in E:\Portal\jobvm\jobseeker\mailTest.php on line 48
this is the problem i will get when testing using swift mailer...does anyone know how to solve this
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

cade wrote:
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 <kelamkabut@example.com>... we do not relay <webmaster@virtualmalaysia.com> in E:\Portal\jobvm\jobseeker\mailTest.php on line 48
this is the problem i will get when testing using swift mailer...does anyone know how to solve this
You've got the wrong SMTP setting in php.ini. That's a relaying denied message. You'll have to find out the correct SMTP server to send outgoing email.
Post Reply