I want to create a website which will automatically create an email address for my domain name whenever my visitor opts for my product. I had tried with manually but it is a TDS work so I want to automate the same.
for eg:
adam123 signs up to my member's site.
The website should run a script where the email address is created automatically.
Email to adam123#my-domain.com goes to johns email address: adam123#hotmail.com and mymail#my-domain.com
To create an email address and a forwarder you need to have access to the underplaying administrator API from your email environment. Depending on your hoster this might not be possible and there might be legal security reasons why this isn´t possible. Additional you might need a special API to control the unterlaying email environment and there is no general one. As you didn´t specify which email environment you are using its not really possible to provide you something.
So for example if your server is running Plesk you might wish to try to use the Plesk API and the manage email API from it.
Related
I need my customers to forward me the emails received on their Gmail account from certain email addresses.
To avoid them to setup these rule manually, I was wondering to use Gmail APIs to create a path where user just select the Gmail account and delegate us to setup the forwarding filter.
This works well, I can create/delete/list filters,
Problem arise when the forwarding email address is not already set, i.e. always:
To setup Forwarding address, domain-wide-delegation is required, and here starts my problems:
first of all is the meaning of domain-wide-delegation that makes me wonder:
domain would be gmail.com and clearly I'm not an admin of such domain
That means that what I'm trying to achieve it is not possible?
furthermore, I have another issue:
I created a Service Account and I have the
Email,
Key ID,
Client ID
service_account.json file with private key
and Domain Wide Delegation is set as Enabled
but I have not understood how to change the original routine in way of using Service Account instead of oAuth 2.0
I can imagine I have to change from using OAuth 2.0 Client IDs to service account
Can someone explain how to use service account instead of oAuth?
I have to set up an email sending solution, and I haven't yet figured out the best way to do this, I hope you have some ideas. I would like to achieve the following:
Have a central email address like mailinglist#mysite.com.
Behind this list there is a database of email addresses. I would like to be able to extend this list through an API. For example if a new user registers on my site, I want to add them to the list. Or if someone unsubscribes, I want to remove him from the list.
On my website I will place a button, and if the user clicks it their email client opens with the central address prepopulated.
If they send an email to this address, everyone will recieve it who is on the list.
If someone replies also everybody will recieve it.
(The application is written in PHP (Laravel framework) if that is important).
Do you know of any service where I can set up this kind of "mailing list", preferrably for free? (It would have a few hundred members, sending a somewhere around 30-100 emails a month.)
I guess you'll need root access to your (linux) webserver - then you can hook Sympa (read "list of features") into your MailTransportAgent (MTA) (postfix, exim) or whatever.
I'm running a wiki based on mediawiki 1.21.11. Because I can't prevent users to change their e-mail address, I want to get informed (e.g. by mail) about this change.
My question: is there any possibility to send e. g. a copy of the notification mail or another notification including the old or new e-mail address to a specified recipient when users change their e-mail address?
You can prevent users from changing their email address with an auth plugin, although it seems like a horrible thing to do. You can use some hook to send you notifications - PrefsEmailAudit or UserSetEmail if you don't require confirmations, ConfirmEmailComplete if you do.
I saw in some advertising websites, that when you want to send an email to the ad owner, it does not show the real email, but rather the email address under that website's domain(which definitely looks like auto-generated, rather than chosen by the user), say smth like n8MngCo5cHg#example.com.
So, AFA I understand, when an email is being sent to that address, it is being redirected to the ad owner's real email. I am trying to to do the same thing by php.
QSN1 By php script, how to create that email address for the user, when he registers ?
QSN2 Is there a way (again by code) to set up a forwarder, so emails sent to n8MngCo5cHg#example.com automatically will be redirected to user's real email user_email#gmail.com, or I should fetch emails by IMAP from time to time and send to to the user ?
I am using apache2.x/Debian 7, if it matters.
These two questions I found, are for cpanel, but I am not using it or any other UI.
Create an email account with PhP - With some things I need to work around
Create emails accounts using PHP
Thanks
Here is one way that you can create an random 'alias' email address:
$aliasaddress=md5(uniqid(mt_rand(),1)) . "#example.com";
Then, as SyedQarib suggests, you would store the alias address and the actual address in a database, so that your program can get the actual address given an alias address.
Finally, you would need to setup your mail server with wildcarding such that it accepts messages to *#example.com, and forward each incoming message to your PHP script, so that for each incoming message to an alias address, your script would parse the incoming message, capture the alias address that it's addressed to, query the database to find the corresponding actual address, then forward the message to the actual address. For information on how to setup a mail server to forward incoming messages to a script, see http://harrybailey.com/2009/02/send-or-pipe-an-email-to-a-php-script/ or How to setup a mail server?
Tumblr (the short form blogging platform) has a feature where you are given a unique email address (for example, f3sf16a#tumblr.com) that you can email text or images and it automatically formats it into a post for you (as long as the sending email address matches your account email address).
I'd let to set up something similar, but solely as a method to submit images. Ideally, when a user signs up to my site, I'd create a unique address for them and store it in my db (MySQL). If a user emails a photo to that address using the email address they signed up with, i'd route it to a PHP function that breaks it down and handles the upload of content to their account.
How would I go about setting something like this up? Would it be something at the DNS level, or Apache level? Would I need to create a "safe list" of all the "real" email accounts on my domain to pass it through first? Also, I'm using Google Apps for email on this domain, will I need to create some sort of filter on that end?
Any ideas/suggestions would be awesome!
There's another quick and dirty way to make this work...
Setup a "catch-all" address for your domain. In other words, setup your domain so that e-mail sent to any address at the domain automatically gets forward to one catch-all address (i.e. global#mydomain.com).
Then, on the PHP side... Setup a script that periodically checks the e-mail in the global#mydomain.com box. Be sure to check the "To:" field so that you can identify which specific user the message was intended for.
Hope this helps!
It would be at the MTA level. Most MTAs have a facility whereby an email can be piped to an external program; this program would then parse the email and store the image.