Maligun mail not send

After running the code it shows output as follows but mail not send, I also checked the log but it is empty.
Terminal output:
Reading sensor value
Sensor value is: 261
Making request to Mailgun to send an email
Mailgun response is: Mailgun Magnificent API
Reading sensor value
Sensor value is: 261
Making request to Mailgun to send an email
Mailgun response is: Mailgun Magnificent API
Reading sensor value
Sensor value is: 261
Making request to Mailgun to send an email
Mailgun response is: Mailgun Magnificent API
Reading sensor value
Sensor value is: 263
Making request to Mailgun to send an email
Mailgun response is: Mailgun Magnificent API

1 Like

Recheck for apikey and related variables might be causing problem due to incorrect input.

Hi @omkar_kolate,

This issue occures mostly because of the incorrect details of mailgun in conf file. Mainly look the value for below variable

MAILGUN_API_KEY = 'This is the private API key which you can find on your Mailgun Dashboard' 
SANDBOX_URL= 'You can find this on your Mailgun Dashboard' 
SENDER_EMAIL = 'This would be test@your SANDBOX_URL'
RECIPIENT_EMAIL = 'Enter your Email ID Here'

Do let me know in case you need further assistance.

It is due to the incorrect Credentials in the email_conf.py

For the MAILGUN_API_KEY,
On dashboard-> Click on the sandbox link at the bottom-> You’ll be directed to Overview page,click on select button on API tab, now select Python language and copy the API Key

For SANDBOX_URL,
In the API base URL, Copy the part from where “sandbox” starts

For SENDER_EMAIL,
test@Same as SANDBOX_URL

For RECIPIENT_EMAIL,
Enter the email which you have verified as Authorized recipient on Mailgun

API_KEY and DEVICE_ID you already know from earlier projects.

4 Likes

Thank you @miranda.reevan it helped a lot