Solved

PHPMailer

Posted on 2014-10-14
6
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

733 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