Using Sendgrid

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Nelmech
Posts: 2
Joined: 14 Apr 2021, 15:39

Using Sendgrid

Post by Nelmech »

Hello,

I'm just starting to using Mantis hosted on azure and would like to send the email using SendGrind Product.
I found some old topic but not relevant anymore as Sendgrind oblige all the user to use APIKey to send email.
I've tried to follow their documentation described on this URL : https://sendgrid.com/docs/for-developer ... -smtp-api/

1 Create an API Key with at least "Mail" permissions.
2 Set the server host in your email client or application to smtp.sendgrid.net. This setting is sometimes referred to as the external SMTP server or the SMTP relay.
3 Set your username to the string apikey. This setting is the exact string "apikey" and not the API key itself.
4 Set your password to the API key generated in step one.
5 Set the port to 587 (or as specified below).

Which give me something like this :

Code: Select all

$g_use_phpMailer = ON;
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_username = 'apikey';
$g_from_name = 'mymail@domaine.com';
$g_smtp_password = 'SG.XXX';
$g_smtp_host = 'smtp.sendgrid.net';
$g_smtp_port = 587;
$g_smtp_connection_mode = 'tls';
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:d:\home\logfiles\mantisbt.log';
But it's not working, on my log file i've got always the same error :

2021-04-14 15:12 UTC MAIL email_api.php:1432 email_send() ERROR: Message could not be sent - SMTP Error: data not accepted.


Does anyone know how to fix that or know how to use SendGrind with Mantis please??
dregad
Developer
Posts: 58
Joined: 26 Jul 2010, 14:24

Re: Using Sendgrid

Post by dregad »

This is what we use here

Code: Select all

$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.sendgrid.net';
$g_smtp_connection_mode = 'tls';
$g_smtp_username = 'apikey';
$g_smtp_password = '<your api key here>';
The only meaningful difference is that we don't set the port number, so MantisBT defaults to 25. Maybe you can try that.
Nelmech
Posts: 2
Joined: 14 Apr 2021, 15:39

Re: Using Sendgrid

Post by Nelmech »

I've tried with the exact same configuration but still getting the same message error again and again :cry:

DOn't understand why
dregad
Developer
Posts: 58
Joined: 26 Jul 2010, 14:24

Re: Using Sendgrid

Post by dregad »

Firewall ?
Post Reply