Page 1 of 1
PopB4Smtp ?
Posted: Thu Mar 22, 2007 9:24 am
by Khalybzh
Hi
I have a probleme with the smtp connexion :
I use a wanadoo connexion but a would like to send mail with smtp.free.fr . The connexion error tell me :
Expected response code(s) [250] but got response [503 Error: access denied for xxxx-ip-xxxxxx .abo.wanadoo.fr[xxx.xxx.xx.xxx]]]
So , I think a need to use a pop authentification b4 the smtp authentification.
how can I do this ?
I 've read the class POPb4Smtp.php but i don't understand very well.
Thank you

Posted: Thu Mar 22, 2007 9:40 am
by Chris Corbyn
What makes you say you need PopB4Smtp?
You may just need to give your username and password normally. Have you tried:
Code: Select all
$smtp->setUsername("user");
$smtp->setPassword("pass");
$swift = new Swift($smtp);
If you still want to try PopB4Smtp it's a bit ad-hoc because servers don't advertise it so Swift cannot detect it, therefore you need to manually load the authenticator:
Code: Select all
<?php
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
//Apologies for the filename, it's to stop Swift auto-loading it
require_once "lib/Swift/Authenticator/$PopB4Smtp$.php";
$smtp =& new Swift_Connection_SMTP("smtp.host.tld");
//Load the PopB4Smtp authenticator with the pop3 hostname
$smtp->attachAuthenticator(new Swift_Authenticator_PopB4Smtp("pop.host.tld"));
//Continue like normal
$smtp->setUsername("your_pop3_username");
$smtp->setPassword("your_pop3_password");
$swift =& new Swift($smtp);
Posted: Thu Mar 22, 2007 9:55 am
by Khalybzh
ho ok thank you for your reply

I will use different smtp to send newsletters ... I'm creating a configuration to choose smtp serveur but a See it's not possible lol
ps : sorry for my english , i'm french. I hope you understand me ;p
By
Posted: Thu Mar 22, 2007 10:13 am
by Chris Corbyn
You can use whatever smtp server you like

Just pass it in the constructor.
Try:
Code: Select all
//If PHP5
$swift = new Swift(new Swift_Connection_SMTP(Swift_Connection_SMTP::AUTO_DETECT));
//PHP4
$swift =& new Swift(new Swift_Connection_SMTP(SWIFT_SMTP_AUTO_DETECT));