Closed stefanodvx closed 3 weeks ago
Hello, at the moment it is not possible to send a message to address @proton.me/@protonmail.com because this requires additional encryption. For now, use a different address.
@opulentfox-29 tried again sending email to a gmail.com address. now i dont get any error, and i get a Message object back. but no message is sent? I checked both proton and gmail accounts, there's nothing sent.
I can’t know why this happened, if the code worked without errors, then the letter should have been sent, maybe you changed your account settings? I test it on a clean, newly created account and everything works, it sends emails to Gmail and Tempmail. try to create a new account and check on it, and you can also look at drafts, because before sending a email, it created draft.
my code:
from protonmail import ProtonMail
username = "...@proton.me"
password = "..."
proton = ProtonMail()
proton.login(username, password)
private_key = '...@proton.me-....asc'
passphrase = '...'
proton.pgp_import(private_key, passphrase=passphrase)
recipients = ["...@gmail.com", "...@bustayes.com"]
subject = "My first message"
body = "Ciao!" # html or just text
new_message = proton.create_message(
recipients=recipients,
subject=subject,
body=body
)
sent_message = proton.send_message(new_message)
Is there a way to send the message without the signature attached?
Is there a way to send the message without the signature attached?
This will now be the default. https://github.com/opulentfox-29/protonmail-api-client/issues/6
@stefanodvx maybe there was a problem with the private key, in the new version 1.4.0 all keys are received automatically, try sending a message now to gmail.com
pip install protonmail-api-client==1.4.0
from protonmail import ProtonMail
username = "YouAddress@proton.me"
password = "YourPassword123"
proton = ProtonMail()
proton.login(username, password)
recipients = ["to@gmail.com"]
subject = "My first message"
body = "<html><body>hello, i sent my first mail!</body></html>"
new_message = proton.create_message(
recipients=recipients,
subject=subject,
body=body
)
sent_message = proton.send_message(new_message)
also do not forget that gmail can identify all letters from protonmail as spam\scam, check your spam folder. and all the messages you sent in protonmail are not in the “inbox” folder, but in the "sent" folder or in the "all mail" folder if the message could not be sent, maybe there will be a draft
works. ty.
HI! I'm trying to send a message... This is my current code (without the login part)
...and this is the error i get