Solved

PHPMailer

Posted on 2014-10-14
6
372 Views
Last Modified: 2014-10-15
Dear experts,

I wish to know the difference between Mail(), IsSMTP(), and IsSendMail() function from a php library called PHPMailer.

When should I use what function and which will be a better choice if I use a online web hosting plan as in shared hosting instead of dedicated host. Thanks

I've encountered an issue which I called a function Send() but the program didn't send out an email.

If i use SMTPDebug, will it shows me the possible errors?
0
Comment
Question by:Kinderly Wade
6 Comments
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40381473
Even if you use SMTP , you need to be enabled the SMTP account on the hosting package.

Otherwise, you can use google (gmail) smtp details to send email from your hosting.  

ref. http://phpmailer.worxware.com/?pg=examplebgmail

It has example of gmail smtp with error display details.
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40381496
If i use SMTPDebug, will it shows me the possible errors?

Open in new window


 $mail->ErrorInfo;   this will list out the possible errors on SMTP related.

like,
SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
SMTP Error: Could not connect to SMTP host.
0
 
LVL 25

Accepted Solution

by:
Marcus Bointon earned 500 total points
ID: 40381600
Please don't link to obsolete docs - PHPMailer moved to Github ages ago.

The differences are:

isMail(): sends using PHP's built-in mail() function, which usually means it will call your local sendmail binary internally, as determined by your php.ini settings. You need to have a local mail server for this to work.

isSendmail(): send by calling your local sendmail binary directly via popen() - this can be slightly faster, and also give you a little more control if you're using a non-standard sendmail (e.g. like qmail's emulation). You need to have a local mail server for this to work.

isQmail(): the same as this but changes the default path to qmail's qmail-inject binary, and alters the command line params to be compatible with qmuil.

isSMTP(): sends using SMTP directly to a specific server. This uses the bundled SMTP PHP class. The advantage of this is that you gain fine control over the SMTP conversation, detailed feedback on delivery, and you can send from servers that do not have a local mail server installed (e.g. most Winfows servers). Its main disadvantages are that it can be slow (SMTP is not good for interactive use (e.g. during a page submission)), and it's not a complete MTA and does not handle queuing, bounces, retries etc.

SMTPDebug shows debug information about and during the SMTP conversation and complete session transcript. It accepts values between 0 and 4, where 0 is no debug info and 4 is the most.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Closing Comment

by:Kinderly Wade
ID: 40381785
Thanks Squinky. You just answered my question right on the spot.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 40381788
I expect you're at the threshold of a journey that will be filled with darkness, anguish and frustration.  Email is one of those things that seems like it should be so easy... Until you try to make the email system work in a secure, predictable and sensible manner.  Then you find that it's full of bad design, hopeless incompatibilities, competing ISPs, spam, viruses, phishing, bizarre data losses, stolen identities, fraudulent messages, and a complete lack of accountability.  Your journey will include many angry phone calls saying, "I didn't get the email!" and "Why am I getting this email?" and "Why did he get the email before I did?"  When you find (as we all do) that your time spent wrestling with your automated email is a real drag on your life, you'll wish for an alternative.  

In 2008, I shut down all the automated email systems I had written (thousands of clients) and turned to ConstantContact.com.  I recommend that you use Constant Contact instead of trying to use an automated PHP library that you don't understand.  CC are efficient, effective and embarrassingly inexpensive, when compared to the time and cost that you're facing by trying to do all of this yourself.

There are competing services, for example Mail Chimp, and the like, but CC was the most professional and there was essentially no difference in cost.  They offer a free trial and can have you up and running within a few minutes.  Most importantly, they are consummate professionals who truly understand the email system and who spend 100% of their professional life getting email right.  When I first experienced their service I was reminded of the famous quote from the firefighter Red Adair: "If you think it's expensive to hire a professional, just wait till you hire an amateur!"

Firing myself and hiring Constant Contact is a decision I have never regretted.  Best of luck with your project, ~Ray
0
 

Author Comment

by:Kinderly Wade
ID: 40381813
Hi Ray,

Thanks for suggesting alternative method. Yes I did get complaints of customer not receiving the emails.... The actual reason why that something I can't answer but I believe it is probably categorized as spam or somehow the client email filtered out the email (very very hard to predict).

I will definitely give ConstantContact.com a try. Thanks again Ray.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question