Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After having dificulting with SMTP email support and failing to enable smtp.class-1.0.5.tar.gz solution, I created the following smtp_library which uses phpmailer. This solution is working great on my Linux box so I thought I'd share with the rest of the world.
Comment | File | Size | Author |
---|---|---|---|
phpmailer.zip | 1.29 KB | rinehart |
Comments
Comment #1
ax CreditAttribution: ax commentedshouldn't this go into http://cvs.drupal.org/viewcvs/contributions/tricks/ ? not sure anyone will find in here.
Comment #2
IamPter CreditAttribution: IamPter commentedI imagine this will not work with 4.6.2? If not is there another solution for drupal to send email with smtp auth and such?
Comment #3
lotherius CreditAttribution: lotherius commentedTHIS WORKS!
Comment #4
tbox CreditAttribution: tbox commentedPhpmailer works but what I dont understand is why it didnt explain how it works or the difference from class.smtp? Any reason why drupal itself couldnt handle my outgoing emails via my Exchange?
This is all on my MS WinXP+apache1.3+MySQL3.23+php4+drupal4.6.3
1. extracted phpmailer.zip to c:\temp
2. created the folder phpmailer under the drupal\include directory
3. copied the two files to drupal\include
4. restarted apache (was this needed?)
5. Send email
And it works.
Nicholas
Comment #5
sbirnie CreditAttribution: sbirnie commentedyou didn't have to edit any config file to get it to work?
Comment #6
paddywwoof CreditAttribution: paddywwoof commentedI had to resort to phpmailer to get email working on a site using shared hosting on IIS see:
http://drupal.org/node/29888#comment-60793
however I had trouble with simplenews and in the end I had to change the simplenews.module by:
- replacing the body of the function sn_mail_send with essentially the content of phpmailer.inc (see below) and
- replaceing the variable $mail with $snmail so it didn't conflict with the variable of the same name in phpmailer.
There are probably better ways of doing this
/**
* Mail engine
*/
function sn_mail_send($snmail) {
$snmail->to = trim($snmail->to);
include_once 'includes/phpmailer.inc';
return user_mail_wrapper($snmail->to, $snmail->title, $snmail->message, '');
}
paddy http://www.eldwick.org.uk/
Comment #7
gorlok CreditAttribution: gorlok commentedThis works fine for me! This help me a lot!
My setup:
THANK YOU GUYS!!!
-Gorlok@Argentina
Comment #8
peekj CreditAttribution: peekj commentedWorks for me on 4.7b4 but it does throw an error with headers, so the next page does not load...
Comment #9
orundg CreditAttribution: orundg commentedI have version 4.6.5 and fixed my header errors by deleting the blank lines at the end of phpmailer.inc
Comment #10
crashpoint CreditAttribution: crashpoint commentedi tried out this patch and it worked. Thanks a lot
Comment #11
bigbman CreditAttribution: bigbman commentedDid anyone ever get this working to support multiple recipients? Does it matter in Drupal (does it send emails one by one)?
Comment #12
leed CreditAttribution: leed commentedI am getting
Fatal error: Class 'PHPMailer' not found in C:\XAMPP\xampp\htdocs\xampp\drupal\includes\phpmailer.inc on line 5
message.
What did I do wrong?
Comment #13
Amazon CreditAttribution: Amazon commentedThis is not an User experience issue. Use the support forums.
Make a file with this:
phpinfo();?>
Then look to see if you have mail options included you PHP.
Comment #14
cosmicdreams CreditAttribution: cosmicdreams commentedNo response after a year. Closing.