Hello Community,
I was wondering if there is a way to make dynamic email address that'll look like this example example_name1@subdomain.example.com or example_name2@subdomain.example.com the subdomains have been created using .htaccess and a wildcard subdomain.

So the "example_name" and "subdomain" would be created dynamically.

So can this be done using .htaccess? or anything similure?

Recommended Answers

All 5 Replies

You have to configure a mail server host on your own server or use the API of your host service.

I can't seem to find anything that helps.

Is there even a way to make an email address like this this service http://www.fakemailgenerator.com ? I'm not wanting to make a fake emailing service but I want to make a system that creates email addresses like it, just type an email address the users wants and straight away it works like a normal address where the user can even check the email.

I assumed this can be done in cpanel under default address. This will allow you to catch all email addresses and then pipe it to a PHP program to create the email account.

So, if some_user@yourDomainDotCom is dynamically created, then it will be forwarded to the default forwarding address created in the cpanel. This can be piped in to a PHP program to check if this email address already exists in the database, if NOT then a new account can be created.

Another alternative is to dynamically create a non-existing email address.

For more information on how to pipe application, please read your cPanel documentation.

If you need a simple generator script, please let me know so that I can provide you with example.

Yeah could you please give me a script. That'll help a lot.

I've tried using these instructions but when I try sending an email to the address doesnexist@example.com I get an email (to the email address I'm sending the test email from) back with the subject "Delivery Status Notification (Failure)" I've tried many times but all don't work, I've even tried setting the default address to forward email to another email address but still get the same result.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.