Swift Mailer Support Thread (Split from Source)
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Swift Mailer Support Thread (Split from Source)
NOTE: This thead has been split from it's original thread here: viewtopic.php?t=48055
Note: 0.0.4 added.
Just a note about forthcoming features - maybe a month or two away yet though:
Built-in changes:
*Much faster* handling of BCC, CC [Done & tested, 22nd May 2006!]
New encoding types; binary, utf8
TLS Support (Gmail servers!!)
Embedded images
More concise error codes
Bundled plugins being added:
Auto-reconnect on failure
Unlimited redundant SMTP connections [Done & tested, 22nd May 2006!]
(Possibly) Multiple simultaneous connections - likely not possible with PHP alone
Die verbosely on error (Swift dies quietly by default)
Logger (XML, Database (Mysql), Flat-file (default comma separated, changeable))
(Possibly) Dummy test for spam scoring with spamassassin (you'll need perl!)
There will be an additional few small optimizations.
Note: 0.0.4 added.
Just a note about forthcoming features - maybe a month or two away yet though:
Built-in changes:
*Much faster* handling of BCC, CC [Done & tested, 22nd May 2006!]
New encoding types; binary, utf8
TLS Support (Gmail servers!!)
Embedded images
More concise error codes
Bundled plugins being added:
Auto-reconnect on failure
Unlimited redundant SMTP connections [Done & tested, 22nd May 2006!]
(Possibly) Multiple simultaneous connections - likely not possible with PHP alone
Die verbosely on error (Swift dies quietly by default)
Logger (XML, Database (Mysql), Flat-file (default comma separated, changeable))
(Possibly) Dummy test for spam scoring with spamassassin (you'll need perl!)
There will be an additional few small optimizations.
Last edited by Chris Corbyn on Fri Jun 16, 2006 5:17 am, edited 1 time in total.
Pimptastic | Please use
I also tried smtp_authentication.php. Entered the username and password for my account on the Verizon smtp server (Verizon is my ISP) - outgoing.verizon.net. It gave me a "Didn't authenticate to server" error. I used the same username and password that work with my Verizon server for sending email.
I'm using php 4. Shared hosting plan.
Any suggestions?
Aaron
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'm having trouble getting this to work.
I tried basic_sendmail.php.
It enters this section (echoes "entering mailer" correctly), and doesn't give any kind of error message. But I don't get an email sent to my address.Code: Select all
if (!$mailer->hasFailed())
{
echo ("entering mailer");
//Sends a simple email
$mailer->send(
'"Aaron" <aaron@campusactivism.org>',
'"Your name" <you@yourdomain.com>',
'Some Subject',
"Hello Joe it's only me!"
);
//Closes cleanly... works without this but it's not as polite.
$mailer->close();
}I also tried smtp_authentication.php. Entered the username and password for my account on the Verizon smtp server (Verizon is my ISP) - outgoing.verizon.net. It gave me a "Didn't authenticate to server" error. I used the same username and password that work with my Verizon server for sending email.
I'm using php 4. Shared hosting plan.
Any suggestions?
Aaron
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Remove the line that calls $mailer->loadAuthenticator(). There's actually some auto-loading that will occur in the background if you don't call that line (sorry not documented yet :-\ ) You'' have 3 different authentication options this was as opposed to just the one.
Try it again after that. If the username and password you're using is just for the hosting it may not neccessarily be for SMTP authentication too (sorry to sound patronising) and it may just work without authenticating at all. Sorry I forgot if you mention if this is a windows or linux server, if it's linux use the sendmail connection, it's much faster and less restrictive because it runs locally.
EDIT | Can you provide me with a print_r() of $mailer->transactions after you call close() as well please... it should make it really clear where the problem lies.
Try it again after that. If the username and password you're using is just for the hosting it may not neccessarily be for SMTP authentication too (sorry to sound patronising) and it may just work without authenticating at all. Sorry I forgot if you mention if this is a windows or linux server, if it's linux use the sendmail connection, it's much faster and less restrictive because it runs locally.
EDIT | Can you provide me with a print_r() of $mailer->transactions after you call close() as well please... it should make it really clear where the problem lies.
Last edited by Chris Corbyn on Fri May 26, 2006 4:09 am, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Getting smtp_authentication.php to work
I removed the line. It still doesn't work.d11wtq wrote: Remove the line that calls $mailer->loadAuthenticator(). There's actually some auto-loading that will occur in the background if you don't call that line (sorry not documented yet :-\ ) You'' have 3 different authentication options this was as opposed to just the one.
Try it again after that. If the username and password you're using is just for the hosting it may not neccessarily be for SMTP authentication too (sorry to sound patronising) and it may just work without authenticating at all. Sorry I forgot if you mention if this is a windows or linux server, if it's linux use the sendmail connection, it's much faster and less restrictive because it runs locally.
EDIT | Can you provide me with a print_r() of $mailer->transactions after you call close() as well please... it should make it really clear where the problem lies.
print_r of $mailer->transactions gives an empty array() .
I've got Linux running PHP as CGI. I'm not sure if that or any other weird permissions stuff could affect this? I'm not an expert on permissions. I know that the mail() function works. My host may have restricted the permissions for the PHP user.
Username/password are for my ISP. My host is a different company.
After removing the one line, I get an error when I try to debug it (using Zend Studio) - but this error doesn't appear when I run it on my local apache server.
Debug Error: C:\webserve\eactobj\standalone\Swift-0.0.4-php4\Swift\Swift_LOGIN_Authenticator.php line 44 - Cannot redeclare class swift_login_authenticator
I got rid of this error by commenting out the first require('../../Swift/Swift_LOGIN_Authenticator.php');
And it still didn't work. The $mailer->transactions is still an empty array
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Getting smtp_authentication.php to work
In which case it's failing to even connect to the SMTP server because at the very least there should be handshake in the log.... you can PM me the code you're using if you like. Try using telnet to connect to the SMTP server on port 25 from the same server. PHP needs fsockopen() for this to work too - although it's unlikely you don't have that.
Last edited by Chris Corbyn on Wed May 24, 2006 3:58 am, edited 1 time in total.
I've been trying this two places
1) on my local pc, runs windows xp, and a local apache server.
2) on my shared-hosting plan.
From my local computer I can telnet to outgoing.verizon.net 25.
From my shared hosting plan it doesn't connect. It says "connection refused". Could they be black-listing my hosting company?
1) on my local pc, runs windows xp, and a local apache server.
2) on my shared-hosting plan.
From my local computer I can telnet to outgoing.verizon.net 25.
From my shared hosting plan it doesn't connect. It says "connection refused". Could they be black-listing my hosting company?
Ok, we fixed some PHP 4 bug. Now I'm getting and Unknown MAIL FROM parameter error message when I try it with outgoing.verizon.net. I've occasionally read that verizon only accepts email from @verizon.net accounts. However I tried it with an @verizon.net account and it didn't work.
This is print_r($mailer->transactions)
However, it works with another SMTP server that I have access to. So this must be a Verizon issue.
d11wtq | Editted post to remove username and password (nobody prob noticed but they are only base64 encoded)
This is print_r($mailer->transactions)
Code: Select all
X-Powered-By: PHP/4.4.1
Content-type: text/html
Array
(
[0] => Array
(
[command] =>
[time] => 0.86916800 1148542498
[response] => 220 vms042pub.verizon.net -- Server ESMTP (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005))
)
[1] => Array
(
[command] => EHLO SwiftUser
[time] => 0.04218100 1148542499
[response] => 250-vms042pub.verizon.net
250-8BITMIME
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-HELP
250-XLOOP EF1F1B2865031BD3EA25D4A94279C48C
250-AUTH PLAIN LOGIN
250-AUTH=LOGIN
250-ETRN
250-NO-SOLICITING
250 SIZE 20971520
)
[2] => Array
(
[command] => AUTH LOGIN
[time] => 0.13603200 1148542499
[response] => 334 VXNlcm5hbWU6
)
[3] => Array
(
[command] => fgsdhsfvstsre
[time] => 0.22908500 1148542499
[response] => 334 UGFzc3dvcmQ6
)
[4] => Array
(
[command] => sbgsdhsfds
[time] => 0.32310400 1148542499
[response] => 235 2.7.0 LOGIN authentication successful.
)
[5] => Array
(
[command] => mail from: "Aaron Kreider" <seacdsl@verizon.net>
[time] => 0.41716600 1148542499
[response] => 555 5.5.4 Unknown MAIL FROM parameter <seacdsl@verizon.net>.
)
)d11wtq | Editted post to remove username and password (nobody prob noticed but they are only base64 encoded)
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I figured out the Verizon problem.
Verizon works if you take out the part in double quotes.
So this works:
But this won't work:
Verizon works if you take out the part in double quotes.
So this works:
Code: Select all
$mailer->send(
'<aaron@campusactivism.org>',
'<seacdsl@verizon.net>',
'Some Subject',
"Hello Joe it's only me!"
);Code: Select all
$mailer->send(
'"Aaron Kreider"<aaron@campusactivism.org>',
'"Joe Spammer"<seacdsl@verizon.net>',
'Some Subject',
"Hello Joe it's only me!"
);- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I'm getting very mixed results. Do you think Verizon might be blocking my emails from my domain? I've only sent perhaps 100 emails using their service, and the largest batch would be under 50.
I can get the SMTP authenticated version to work when I run it on my local PC.
But when I run it on my server, I get the following error message:
Errors: Array ( [0] => Array ( [num] => 0 [time] => 0.39859900 1148595415 [message] => Connection to the given MTA failed ) ) . Log: Array ( )
It was working yesterday on my server (running version 0.0.4). I tried it with both versions (0.0.4 and 1.0.0) and get the same results.
FYI: it takes about 0.5 seconds/email when it works.
I can get the SMTP authenticated version to work when I run it on my local PC.
But when I run it on my server, I get the following error message:
Errors: Array ( [0] => Array ( [num] => 0 [time] => 0.39859900 1148595415 [message] => Connection to the given MTA failed ) ) . Log: Array ( )
It was working yesterday on my server (running version 0.0.4). I tried it with both versions (0.0.4 and 1.0.0) and get the same results.
FYI: it takes about 0.5 seconds/email when it works.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
The time per email you see is network traffic if you're using the SMTP connection. It's been tested with the sendmail connection to be massively faster and the only real difference is the network not being used. If the production server runs linux I strongly advise using sendmail instead of remote SMTP. The mails will not be delivered instantly but they will queue on the mail spool which is good since it's left PHP's hands.
As for verizon connection issues. If it's not connecting from one place but it is from another I'm not sure what could cause that I'm afraid. If I'm understanding you correctly you can't telnet to the server neither - can I just clarify that so that?
As for verizon connection issues. If it's not connecting from one place but it is from another I'm not sure what could cause that I'm afraid. If I'm understanding you correctly you can't telnet to the server neither - can I just clarify that so that?