Facing login error using Mailgun with Nodemailer. My API key works with Gmail. See revised code:
mailerConfig = createTransport({
provider: 'Mailgun',
auth: { user: 'api', key: 'XYZ987' }
});
Facing login error using Mailgun with Nodemailer. My API key works with Gmail. See revised code:
mailerConfig = createTransport({
provider: 'Mailgun',
auth: { user: 'api', key: 'XYZ987' }
});
I encountered a similar issue when integrating Nodemailer with Mailgun. In my experience, direct configuration of SMTP settings rather than using the provider shortcut can help isolate the problem. I switched to explicitly setting the host, port, and secure options along with the correct authentication credentials. Often the key is using the proper username format, which usually involves a full email like ‘[email protected]’ rather than a generic ‘api’. Make sure that your configuration details align with Mailgun’s documentation regarding SMTP connections.