Python sending E-Mail without an existing E-Mail?

Viewed 30

I already learned to send E-Mails with python using my existing E-Mail address as the sender.

  1. Is it possible to send E-Mails without an existing E-Mail address (like YoK23L1s-kis@outlook.com or even loxzy22_2osy@xyza.ccc)? Or is it necessary to sign up at an E-mail provider like gmail/outlook/...?

  2. If it is necessary, is it possible to generate an E-Mail address with Python?

  3. How do spammers create their E-Mail addresses? They look so random as they are generated.

1 Answers

Your question is off-topic, as it's not directly programming related, and it's also a fairly large question. You may get faster and more detailed answers in a web search.

Mail servers will not accept emails without a sender. This is because in case they cannot deliver the email, they need to bounce it (return it to the sender). You can leave out the FROM: header, and that may make you look like a spammer or poor sender, but you need to pass a MAIL FROM: <me@example.org> SMTP command when you try to deliver mail; see RFC 5321

You can generate any email address you want (see RFC 2822 for syntax details). The receiver has no way to tell whether that is a valid email address. Only your (incoming) mail server decides whether to accept mail for an address. If you run your own email sender you're in charge of the addresses.

If you don't run your own email server, you can use someone else's, like Google or sendgrid. In that case these companies assign you email addresses you can use, and they will require you to log in before you can send, so that others cannot send in your name. (Imagine if everybody could send emails coming from your bank.)

Spammers either run their own mail server, or abuse poorly configured mail servers that allow relaying for others (open relays), or sign up for email services and blast out as much as they can before the email service provider kicks them off of their platform.

Related