Jump to content

Upgrading PHP Mailer from 5.2.7 to 5.2.14 and use 3rd party API calls


fdohmann

Recommended Posts

Many WHMCS installations using shared servers at HostGator. The problem is sending mail using shared IP Blocks of HostGator's mail server "cima.websitewelcome.com" like invoices or invoice reminders created by the WHMCS cron never arrive at the recipients mail box. They get, typical for HostGator, their email blocked by "http://emailadmin.registeredsite.com/" caused by spammers in the neighborhood using the same "cima.websitewelcome.com" IP block. This is damaging to our cash-flow.

 

The solution would be to use an API call through a 3rd party mail service provider like "Sendgrid", "Mailgun" or "Mailjet" and bypass the HostGator "cima.websitewelcome.com" mail server. It works great with a single WHMCS email template when properly coded, but it will not work with the daily WHMCS cron job responsible for creating invoices, invoice reminders and overdue messages:( We use the WHMCS -> Mail -> Type PHP Mail() with SMTP Port 465, Host: smtp.sendgrid.net with our username and password (see also https://github.com/PHPMailer/PHPMailer). The modified "class.phpmailer.php" mailer still uses "cima.websitewelcome.com" as it's initial sender. The perfect solution would be to upgrade the WHMCS "class.phpmailer.php" from 5.2.7 to version 5.2.14 and add a "Sendgrid API client" to bypass the HostGator Mail Server, like the Google XOAUTH2 Api client (as an option available) to the internal WHMCS Mail Service.

Link to comment
Share on other sites

  • 4 weeks later...

I have created an addon for WHMCS, that allows you to send all your emails directly to sendgrid, or mailgun via their HTTPS API, and bypass SMTP altogether. It requires only adding 1 line of code to the "class.phpmailer.php" file.

Also included is the ability to track all emails (dropped, bounced, received, opens, clicks) via a webhook back into your WHMCS installation.

 

The OP is currently beta testing, and I am looking for 1 or 2 more users to test. Please PM me if interested.

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated