473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

I am a bit confused about mail(), phpmailer and PEAR:mail

290 100+
I am building my subscriber list which is held in the
mySQL database "client" table and I want to start sending them a newsletter.

My list will probably get up to around 20,000

I would like know if emails are getting through of if they are being rejected, so I can keep the subscriber list clean.

I would also like to send HTML email but with an alternative text email for those that don't except HTML.

Now, I was just going to use php mail() command
from within my own script which simple loops through the client
table, but I read this at php.net:

Note: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient.
For the sending of large amounts of email, see the » PEAR::Mail, and » PEAR::Mail_Queue packages.
It has also been suggested that I use phpMailer or SwiftMail.

Now,
I have to admit I am a bit confused though.

Having read a few tutorials about all this

There is phpMailer
and there is SwiftMail
and there is PEAR:Mail

Are these three just similar methods of doing the same thing ?
i.e. they are all OOP classes that in the end use the
php mail() command ?


Then there is Sendmail.

I think sendmail is a server program like postfix - is that right ?

And does the mail() command send the email out using the server program ( sendmail or postfix ) ?

I have downloaded phpMail and about to install it but,
to be honest I am not sure is setting up phpMailer is the way to go
, would PEAR be better ( or even Swift) ?

Can't use both I guess if they do the same thing !!

Would very much appreciate it if someone could explain the relationship of all these "bits" of the puzzle.

Thanks
Apr 11 '09 #1
5 7620
Markus
6,050 Expert 4TB
The first problem you ask about (knowing whether the mail is sent successfully) is a hard one to do reliably. Because you cannot check if an email is valid by just sending an email to an address (the email client for that email address will not tell you if it's valid - that would be a spammers wet-dream), you'd have to have a link inside the email that the user should follow to confirm they are reading the news letters, and then delete the emails that don't reply. However, this isn't reliable because not all people check their emails consistently.

Sending an HTML email and a plain text email to the same address is over-kill. Have an option (stored in your database) that the user selects, to send either HTML or plain text.

I'm not a fan of PEAR packages. SwiftMailer is pretty much the de facto standard when sending emails now. I'm not sure if they use the mail() method, but I think I have read that they don't and that is why they're a good tool to use.

SwiftMailer is the best option. Reason being: it is a well structured library / class; has many different features; and generally does everything you need from a mail class. It also allows for plugins to extend it's functionality.

You could use both, but what would be the point?

Go SwiftMailer - not PHPMailer because it is no longer actively developed / the documentation is little, and, compared to SwiftMailer, it lacks a lot of functionality.

Hope this helps,

- mark.
Apr 11 '09 #2
if you have your server details handy with you. I think that the mail function is a best option.
Apr 13 '09 #3
Dormilich
8,658 Expert Mod 8TB
I have to disagree with this. Markus is right recommending Swiftmailer (although I'm of the opinion that writing a html/text multipart message is not an overkill)
Apr 13 '09 #4
Markus
6,050 Expert 4TB
@Dormilich
I'm not against sending an hmtl/text multipart message, but against send a plain text message AND an html one, which is what I believe the OP is doing.

I would also like to send HTML email but with an alternative text email for those that don't except HTML.
- mark.
Apr 13 '09 #5
Dormilich
8,658 Expert Mod 8TB
ah, that makes sense.
Apr 13 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: joealey2003 | last post by:
Hi all... A simple mail example like... <? mail("acco...@yahoo.com","Subject of Message","Message"); ?> does not work to yahoo or spymac.com, but the same works to gmail and other servers.
3
by: awebguynow | last post by:
after reading many posts, I'm looking for reccommendations on SMTP and mail() alternatives on Windows XP. I've seen blurbs on: PHPMailer Pear::Mail or Pear::MailQueue Pkgs mimemail
3
by: bombardier | last post by:
I have a PHP script that I copied and modified from the SourceForge.net website that I cannot get to work. The problem seems to be that the value for $mail is not recognized. The script fails...
2
by: prasenjit2007 | last post by:
Hello, can u help me sending Email with attachments using the Class phpMailer. On the website I have a link to an html form in which I input the parameters with the names 1)from(textbox name)...
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
3
by: maheswaran | last post by:
Hi , Am new in PEAR. I have using PEAR/Mail.php for sending mails using smtp authentication. Here that my mailto form. <?php session_start(); ini_set("smtp_port",25); include("Mail.php");...
7
by: John Drako | last post by:
Currently, I run postfix on my own server to send message from my site (password requests, account activation notices and other messages). I have phpMailer on the server and all the messages...
13
by: Beauregard T. Shagnasty | last post by:
My shared web host has made some sort of upgrade to .. something .. the support tech can't tell me what. It's a cPanel system, with all the regular stuff. The site is a club site. For years, I...
2
mikek12004
by: mikek12004 | last post by:
Before posting here I google it and saw ablut 30 pages for a solution so I pretty much excluded the obvious things. The code is <?php //now to send the mails to seller...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.