Closed ihsanmohamad closed 3 years ago
use SportJom in MAIL_FROM_NAME attribute and MAIL_USERNAME sportjom@gmail.com
use SportJom in MAIL_FROM_NAME attribute and MAIL_USERNAME sportjom@gmail.com
thank you for that, I just realised that I have MAIL_FROM_NAME option in the new version. However it seems like I need to have both MAIL_FROM and MAIL_FROM_NAME, else it would throw pydantic error "MAIL_FROM field required".
The second email is the one that I received using fastapi-mail, while the first one received from me manually sending the email.
Yes exactly, we discussed this at #16 It is available as new feeature. you are required to provide MAIL_FROM as well.
Hi yes, I did that and the result is like from the image from my previous reply with the second email. How do I achieve the result like the first email?
Here is how I setup my config
My current setting will also include my email. I would like to get result like this SportJom <sportjom.my@g mail.com>
Thank you and sorry for the inconveniences!
Hi yes, I did that and the result is like from the image from my previous reply with the second email. How do I achieve the result like the first email?
Here is how I setup my config
My current setting will also include my email. I would like to get result like this SportJom <sportjom.my@g mail.com>
Thank you and sorry for the inconveniences!
Hi @ihsanmohamad, thank you for using fastapi-mail. I tested your method and it worked. Here is how I setup my config:
and I got the email as you wanted: Can you explain the situation in more detail?
use SportJom in MAIL_FROM_NAME attribute and MAIL_USERNAME sportjom@gmail.com
thank you for that, I just realised that I have MAIL_FROM_NAME option in the new version. However it seems like I need to have both MAIL_FROM and MAIL_FROM_NAME, else it would throw pydantic error "MAIL_FROM field required".
The second email is the one that I received using fastapi-mail, while the first one received from me manually sending the email.
but if you want to receive an email and the sender's name then you can correct the config when you send an email
here is an example:
and the result is:
Oh my god, I felt stupid and embarrassed. Turns out it was my windows mail having that result. On my gmail opened from web, it works as expected. Even though I just knew about MAIL_FROM_NAME new attribute in the latest release (i was using release 0.2.8.5), I can't believe it was such a stupid mistake coming from the windows mail.
Sorry for the trouble, thank you so much for providing assistance to me. Much appreciated.
Happy to see you resolved the issue. Thing happens, it is okay :) at least you figured out the problem
I have been struggling with send email using this module but even after enabling "LESS SECURE APP" on my gmail account I always get this error: fastapi_mail.errors.ConnectionErrors: Exception raised Error connecting to smtp.gmail.com on port 587: [Errno 10061] Connect call failed ('74.125.140.109', 587), check your credentials or email service configuration. I have checked my login detail but all to no avail ` message = MessageSchema( subject="EasyShopas Account Verification Mail", recipients=email, # List of recipients, as many as you can pass body=template, subtype="html" )
fm = FastMail(conf)
await fm.send_message(message)
`
im having an issue similar to @rextech03 's
Exception raised (535, '5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials 78-20020a250d51000000b00b7767ca7487sm181675ybn.36 - gsmtp'), check your credentials or email service configuration
using this configuration, that has worked for some
im having an issue similar to @rextech03 's
Exception raised (535, '5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials 78-20020a250d51000000b00b7767ca7487sm181675ybn.36 - gsmtp'), check your credentials or email service configuration
using this configuration, that has worked for some
sorry i just noticed this isn't actually a problem with fastapi-mail is just that Google security is very tight regarding access from 3rd party apps , just tried with a different mail server and worked like a charm
How do i use gmail alias with "MAIL_USERNAME"? Using gmail, i keep getting bad credential error.
What i'm trying to achieve is SportJom sportjom@gmail.com
but that was not possible if my "MAIL_USERNAME" is not the email address.
For "MAIL_USERNAME" I have to use my full email address as the username. Is this just gmail issue?