Lockhead
Lockhead

Reputation: 2451

PHP sending emails through random email accounts

I'm working on a website that allows you to send emails without registering, and without specifying a sender. You enter the recipient's address, subject, body and send. My problem is sending the message. What I'm trying to achieve:

User clicked send -> Subject,recipient,body sent to PHP -> Server validates the information -> Server creates a random email account -> Server sends the email through the random account created -> Server deletes the account

I'm stuck at the random email account creation step. How do I achieve this with PHP without having to pay for my own SMTP server and without having to use my own gmail/hotmail account.

I googl'd the hell out of this issue and I can't find an answer.

Thanks!

BTW I'm using Apache to "host" on my own Ubuntu

Upvotes: 2

Views: 2266

Answers (2)

matthewpavkov
matthewpavkov

Reputation: 2928

I don't believe you can create accounts or email accounts on a server, using PHP, as this supersedes PHP's permission level. Sending emails this way is a good way to get your server banned, FYI. Also, if you insist on sending emails like this, why not just specify a dummy From: email address? It would essentially be the same thing as creating a dummy account anyhow.

You may also want to use the -f switch, for PHP's mail(). See php.net/manual/en/function.mail.php

Upvotes: 1

Pekka
Pekka

Reputation: 449603

How do I achieve this with PHP without having to pay for my own SMTP server and without having to use my own gmail/hotmail account.

The way to create E-Mail accounts varies wildly from server software to server software, and is usually not possible from within PHP.

Depending on your server's configuration, though, that might not be necessary: If you set up a catch all address for a domain, many server configurations will allow you to send out mails from any E-Mail on that domain (e.g. [email protected]). Any responses will then go to that catch-all mailbox, the contents of which you will probably want to discard.

You have to realize, though, that this is exactly how spam providers operate. Extreme caution is advised if you don't want to end up on all sorts of spam blacklists.

Upvotes: 4

Related Questions