sendgrid-php VS PHPMailer

Compare sendgrid-php vs PHPMailer and see what are their differences.

sendgrid-php

The Official Twilio SendGrid PHP API Library (by sendgrid)

PHPMailer

The classic email sending library for PHP (by PHPMailer)
Our great sponsors
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Truly a developer’s best friend
  • talent.io - Download talent.io’s Tech Salary Report
sendgrid-php PHPMailer
2 45
1,369 18,717
0.2% 0.7%
7.2 8.6
28 days ago 7 days ago
PHP PHP
MIT License GNU Lesser General Public License v2.1 only
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

sendgrid-php

Posts with mentions or reviews of sendgrid-php. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-09-23.

PHPMailer

Posts with mentions or reviews of PHPMailer. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-10-02.
  • Magento 2: Sending Emails Guide
    2 projects | dev.to | 2 Oct 2022
    As an alternative to using mail() function and SMTP extensions, you can also utilize a very popular PHPMailer. We’ve recently covered it in detail on our blog, check out our guide here.
  • PHPMailer Guide
    2 projects | dev.to | 27 Sep 2022
    PHPMailer is the classic email sending library for PHP. It supports several ways of sending email messages such as mail(), Sendmail, qmail, and direct dispatch to SMTP servers. In addition, it provides a list of advanced features:
  • How to debug mail()? It only returns 1, 0, or null. I'm not sure if gmail is blocking it either.
    2 projects | reddit.com/r/PHPhelp | 25 Sep 2022
    That is utterly simple, and can be readily converted for usage with cURL through PHP without loading any external libraries. No symfony/mailer. No PHPMailer/PHPMailer. Nothing.
  • Anyone know a way to archive slack channels to Gmail? I use Slack for work, which we pay for, but I have a little private one just for some friends I grew up with. I’m looking for a way to just archive all of that communication to a gmail account just for time capsule purposes.
    3 projects | reddit.com/r/Slack | 20 Sep 2022
    You would then need to setup a function to loop over to use json objects and “email them” you could actually use the same inbox(email address) you are storing the data in to send the data to that mailbox. Using SMTP you could use a lib like https://github.com/PHPMailer/PHPMailer to accomplish that piece.
  • Configuring PHP to Send Emails Using Mail( )
    2 projects | reddit.com/r/PHP | 19 Dec 2021
    Frankly, it is better to give up upon sending mails from your own server altogether. Instad of plain mail() just go for PHPMailer or similar and send mails via external, well established provider.
    2 projects | reddit.com/r/PHP | 19 Dec 2021
    Use PHPMailer with SMTP. Saves you a lot of trouble with mails getting caught in spam with using mail()
  • PHP Libraries for sending and parsing email
    11 projects | dev.to | 4 Dec 2021
    PHPMailer - Another mailer solution.
  • I might get an intern as a php dev, only used languages & web frameworks etc. What should I know?
    11 projects | reddit.com/r/PHPhelp | 11 Nov 2021
    Popular Packages & Tools - The League of Extraordinary Packages - Twig Templating engine - PHP Mailer - SwiftMailer - Flysystem file storage - PHPUnit testing - HTML Purifier
  • 10+The Best PHP Projects GitHub 2022
    25 projects | dev.to | 8 Nov 2021
    PHPMailer
  • PHP MAIL Authentication for Gmail Workspace account
    2 projects | reddit.com/r/PHPhelp | 4 Jun 2021
    '); //Replace the plain text body with one created manually $mail->AltBody = 'alternate body text only'; //Attach an image file //$mail->addAttachment('images/phpmailer_mini.png'); //rem'd out for testing //send the message, check for errors if (!$mail->send()) { echo 'Mailer Error: ' . $mail->ErrorInfo; } else { die('Message sent!'); //Section 2: IMAP //Uncomment these to save your message in the 'Sent Mail' folder. if (save_mail($mail)) { echo "Message saved!"; } } //Section 2: IMAP //IMAP commands requires the PHP IMAP Extension, found at: https://php.net/manual/en/imap.setup.php //Function to call which uses the PHP imap_*() functions to save messages: https://php.net/manual/en/book.imap.php //You can use imap_getmailboxes($imapStream, '/imap/ssl', '*' ) to get a list of available folders or labels, this can //be useful if you are trying to get this working on a non-Gmail IMAP server. function save_mail($mail) { //You can change 'Sent Mail' to any other folder or tag $path = '{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail'; //Tell your server to open an IMAP connection using the same username and password as you used for SMTP $imapStream = imap_open($path, $mail->Username, $mail->Password); $result = imap_append($imapStream, $path, $mail->getSentMIMEMessage()); imap_close($imapStream); return $result; } And here is server log from the GOOD send: 2021-06-04 19:16:49 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP w23sm2309597pfi.220 - gsmtp 2021-06-04 19:16:49 CLIENT -> SERVER: EHLO localhost 2021-06-04 19:16:49 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [98.148.179.208]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2021-06-04 19:16:49 CLIENT -> SERVER: STARTTLS 2021-06-04 19:16:49 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS 2021-06-04 19:16:49 CLIENT -> SERVER: EHLO localhost 2021-06-04 19:16:49 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [98.148.179.208]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2021-06-04 19:16:49 CLIENT -> SERVER: AUTH LOGIN 2021-06-04 19:16:49 SERVER -> CLIENT: 334 VXNlcm5hbWU6 2021-06-04 19:16:49 CLIENT -> SERVER: [credentials hidden] 2021-06-04 19:16:49 SERVER -> CLIENT: 334 UGFzc3dvcmQ6 2021-06-04 19:16:49 CLIENT -> SERVER: [credentials hidden] 2021-06-04 19:16:50 SERVER -> CLIENT: 235 2.7.0 Accepted 2021-06-04 19:16:50 CLIENT -> SERVER: MAIL FROM:[email protected] 2021-06-04 19:16:50 SERVER -> CLIENT: 250 2.1.0 OK w23sm2309597pfi.220 - gsmtp 2021-06-04 19:16:50 CLIENT -> SERVER: RCPT TO:[email protected] 2021-06-04 19:16:50 SERVER -> CLIENT: 250 2.1.5 OK w23sm2309597pfi.220 - gsmtp 2021-06-04 19:16:50 CLIENT -> SERVER: DATA 2021-06-04 19:16:50 SERVER -> CLIENT: 354 Go ahead w23sm2309597pfi.220 - gsmtp 2021-06-04 19:16:50 CLIENT -> SERVER: Date: Fri, 4 Jun 2021 19:16:48 +0000 2021-06-04 19:16:50 CLIENT -> SERVER: To: You [email protected] 2021-06-04 19:16:50 CLIENT -> SERVER: From: Me [email protected] 2021-06-04 19:16:50 CLIENT -> SERVER: Reply-To: Me [email protected] 2021-06-04 19:16:50 CLIENT -> SERVER: Subject: PHPMailer GMail SMTP test 2021-06-04 19:16:50 CLIENT -> SERVER: Message-ID: [email protected] 2021-06-04 19:16:50 CLIENT -> SERVER: X-Mailer: PHPMailer 6.3.0 (https://github.com/PHPMailer/PHPMailer) 2021-06-04 19:16:50 CLIENT -> SERVER: MIME-Version: 1.0 2021-06-04 19:16:50 CLIENT -> SERVER: Content-Type: multipart/alternative; 2021-06-04 19:16:50 CLIENT -> SERVER: boundary="b1_LkOADjc1betdlidLdPJObOQDB9WwRw8zw67DopEInbo" 2021-06-04 19:16:50 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: This is a multi-part message in MIME format. 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: --b1_LkOADjc1betdlidLdPJObOQDB9WwRw8zw67DopEInbo 2021-06-04 19:16:50 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: Welcome here 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: --b1_LkOADjc1betdlidLdPJObOQDB9WwRw8zw67DopEInbo 2021-06-04 19:16:50 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: Here is some text in RED 2021-06-04 19:16:50 CLIENT -> SERVER: Here is some text in Green 2021-06-04 19:16:50 CLIENT -> SERVER: Here is some text in Blue 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: --b1_LkOADjc1betdlidLdPJObOQDB9WwRw8zw67DopEInbo-- 2021-06-04 19:16:50 CLIENT -> SERVER: 2021-06-04 19:16:50 CLIENT -> SERVER: . 2021-06-04 19:16:51 SERVER -> CLIENT: 250 2.0.0 OK 1622834211 w23sm2309597pfi.220 - gsmtp 2021-06-04 19:16:51 CLIENT -> SERVER: QUIT 2021-06-04 19:16:51 SERVER -> CLIENT: 221 2.0.0 closing connection w23sm2309597pfi.220 - gsmtp From my local script: Message sent! Then, same attempt using my paid account, here is the SERVER output: 2021-06-04 19:47:40 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP w142sm2436849pff.154 - gsmtp 2021-06-04 19:47:40 CLIENT -> SERVER: EHLO localhost 2021-06-04 19:47:40 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [98.148.179.208]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2021-06-04 19:47:40 CLIENT -> SERVER: STARTTLS 2021-06-04 19:47:41 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS 2021-06-04 19:47:41 CLIENT -> SERVER: EHLO localhost 2021-06-04 19:47:41 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [98.148.179.208]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 2021-06-04 19:47:41 CLIENT -> SERVER: AUTH LOGIN 2021-06-04 19:47:41 SERVER -> CLIENT: 334 VXNlcm5hbWU6 2021-06-04 19:47:41 CLIENT -> SERVER: [credentials hidden] 2021-06-04 19:47:41 SERVER -> CLIENT: 334 UGFzc3dvcmQ6 2021-06-04 19:47:41 CLIENT -> SERVER: [credentials hidden] 2021-06-04 19:47:41 SERVER -> CLIENT: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 https://support.google.com/mail/?p=BadCredentials w142sm2436849pff.154 - gsmtp 2021-06-04 19:47:41 SMTP ERROR: Password command failed: 535-5.7.8 Username and Password not accepted. Learn more at535 5.7.8 https://support.google.com/mail/?p=BadCredentials w142sm2436849pff.154 - gsmtp SMTP Error: Could not authenticate. 2021-06-04 19:47:41 CLIENT -> SERVER: QUIT 2021-06-04 19:47:41 SERVER -> CLIENT: 221 2.0.0 closing connection w142sm2436849pff.154 - gsmtp So, I've double double double checked the UN and PW and it is correct in the script. Thanks in advance for any and all help

What are some alternatives?

When comparing sendgrid-php and PHPMailer you can also consider the following projects:

SwiftMailer - Comprehensive mailing tools for PHP

Mautic - Mautic: Open Source Marketing Automation Software.

Symfony - The Symfony PHP framework

phpList - This module is the core of phpList 4. Join discussion at the community forum: https://discuss.phplist.org/

Symfony Mailer - The Mailer component helps sending emails

omnimail - Send email across all platforms using one interface

Bounce Mail Handler - Bounce Mail Handler for PHP | This is a "reboot" of PHPMailer-BMH from WorxWare.

sendgrid-nodejs - The Official Twilio SendGrid Led, Community Driven Node.js API Library

Fetch - An IMAP library for PHP

PHP Telegram Bot - PHP Telegram Bot based on the official Telegram Bot API

web3.php - A php interface for interacting with the Ethereum blockchain and ecosystem. Native ABI parsing and smart contract interactions.

Email Reply Parser - PHP library for parsing plain text email content.