How to configure SendGrid in cPanel

How to configure SendGrid in cPanel

How to configure SendGrid in cPanel. SendGrid is a cloud-based email service that provides a reliable transactional e-mail delivery, scalability and real-time analysis system along with flexible APIs that facilitate personalized integration.

To configure SendGrid and use it to send mails from a server with cPanel, you should follow these steps …

How to configure SendGrid in cPanel

  • Login to WHM with root privileges (administrator)
  • Enter Service Configuration> Exim Configuration Manger
  • Within this section you can access Advanced Editor
  • Search Section: AUTH and place the following …

 

Sendgrid_login:

Driver = plaintext

Public_name = LOGIN

Client_send =: <YourSendGridUsername>: <YourSendGridPassword>

how to send mail in php using sendgrid

Obviously you should replace the login with valid data. It is important to note that this login will send all the mails that you configure on this server, it is advisable to use one for each computer so that it is not difficult to locate sent emails later.

 

  • Then find Section: PREROUTERS and places this …

Send_via_sendgrid:

Driver = manualroute

Domains =! + Local_domains

Senders = * @ <YourDomainHere>

Transport = sendgrid_smtp

Route_list = “* smtp.sendgrid.net::587 byname”

Host_find_failed = defer

How sendgrid works How to configure SendGrid in cPanel

In the “senders” line you must define the e-mail you want to send to SendGrid separated by colons (eg *@domain1.com: *@domain2.com ), you can also redirect all mail deleting this line, or send all but some using the exclamation mark (eg !*@domainexc1.com: !*@domainexc2.com )

 

  • Then in Section: TRANSPORTSTART…

Sendgrid_smtp:

Driver = smtp

Hosts = smtp.sendgrid.net

Hosts_require_auth = smtp.sendgrid.net

Hosts_require_tls = smtp.sendgrid.net

Save the changes and test the service, you should see the emails you send appear in the SendGrid panel.