mailjet / MailjetSwiftMailer

A SwiftMailer transport implementation for Mailjet
MIT License
26 stars 23 forks source link

Sending simple mail #7

Closed alchy58 closed 7 years ago

alchy58 commented 7 years ago

Hi,

I just discover this bundle so my question is not really related to the lib. If you can't answer it, I will just install it.

So I use SwiftMailer to send emails (ex : registration confirmation) from a website using the Mailjet SMTP. Mails are not sent.

The Symfony profiler says that 1 mail is spooled when I create a user account, but it is never sent. php bin/console swiftmailer:spool:send returns 0 emails sent. I tried memory and file spools.

When using the php bin/console swiftmailer:email :send, mails are correctly sent (mails have the mailjet headers and they are in the mailjet sent mails interface).

When I'm trying the OVH SMTP, mails are correcly sent, so the problem seems to be a SwiftMailer misconfiguration.

app/config/config.yml

swiftmailer:
    transport: "%mailer_transport%"
    host:      "%mailer_host_prod%"
    port:      "%mailer_port_prod%"
    encryption:      "%mailer_encryption_prod%"
    username:  "%mailer_user_prod%"
    password:  "%mailer_password_prod%"
    spool:     { type: memory }

app/config/parameters.yml

    mailer_transport: smtp

    mailer_host_prod: in-v3.mailjet.com
    mailer_port_prod: 587
    mailer_encryption_prod: tls
    mailer_user_prod: api_key
    mailer_password_prod: api_secret

    mailer_host_ovh: ssl0.ovh.net
    mailer_port_ovh: 465
    mailer_encryption_ovh: ssl
    mailer_user_ovh: email
    mailer_password_ovh: password

PS : There is no example about Symfony nor this lib in this page, it could be useful

latanasov commented 7 years ago

Hi @alchy58 difficult for me to say what the issue is. I can see that there is a similar open issue on the swiftmailer-bundle github. Could this be your case ?

Nightbr commented 7 years ago

Hi, I don't think your problem is related to this lib so try it and let us know if you have any issue with our MailjetSwiftMailer and reopen this issue. Thanks!

alchy58 commented 7 years ago

It seems that the problem was because my mails where sent with a wrong domain name. In this case, Mailjet seems to accept the mail, put it in queue and never send it, which result in a successful return in the code. I could but great if we could track receiveid but not relayed emails in Mailjet interface.

latanasov commented 7 years ago

I am not quite sure I understand what you request, but the status of a message can be retrieved from the /message resource. Again your question is not related to this library. If you have general API questions, feel free to open a support ticket on the Mailjet site.