473,761 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

290 Contributor
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_Queu e 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 7711
Markus
6,050 Recognized Expert Expert
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
anubhavjha
22 New Member
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 Recognized Expert Moderator Expert
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 Recognized Expert Expert
@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 Recognized Expert Moderator Expert
ah, that makes sense.
Apr 13 '09 #6

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

Similar topics

9
2862
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
2236
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
1421
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 at the if(!$mail-Send() ) and the unsuccessful message goes out. Can somebody see what is wrong here? Thanks in advance. <? require("class.phpmailer.php");
2
4557
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) 2)To 3) Subject 4) Message5) File input(name abc) - to be sent as an attachment. This form calls the Class PhpMailer through another form with the following code to send the mail. <?php ini_set("include_path",...
7
9822
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 achieve this. Thanks
3
2492
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"); $name=$_POST; $email=$_POST; $phone=$_POST;
7
2772
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 (currently about 1000 messages are sent daily) are sent by SMTP through postfix. I'm contemplating moving this particular site's email to Gmail. Is it possible to send mail through Gmail's servers with authentication and everything?
13
1814
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 have been using the regular old mail(...) function for things like sending broadcast messages to members. Yesterday, that failed. The host now tells me I need to access the SMTP server directly, using a valid email account and password. "It's a new...
2
5895
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 require("class.phpmailer.php"); $mail = new PHPMailer(); //$mail->IsSMTP(); // telling the class to use SMTP //$mail->Host = "smtp.example.com"; // SMTP server $from = "vasilis@emile.com"; $mail->From = $from;
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.