Read Email from Gmail inbox as it arrives - php

I've a drupal 7 site, and requires a functionality by which I can read emails from gmail inbox whenever they arrives. Currently I'm achieving it with php imap by running it on cron.
But I want something, which can read email from inbox as soon as it arrives.
Please suggest, thanks

This would be a bit of a round-the-houses approach but create an account with mailgun.com. Within Mailgun you can then direct incoming emails to a URL you specify. Mailgun parses the email and sends it to you in a structured format.
You could then set up your Gmail account to send a copy of all incoming emails to your Mailgun account.

Related

Mail send with PHP in outbox of a user?

I need to send mail from my PHP app, I wonder if I authenticate as a exchange user via PHPMailer, does my mails send from my app will be on the outbox in the MS Outlook of this user ?
Thanks
On most mail servers, no, this doesn't happen automatically, but you can do it yourself. The gmail example provided with PHPMailer shows how to save a sent message to your outbox using IMAP; it will be nearly identical for Outlook. Alternatively, BCC the original message to yourself and you'll receive a copy of everything you send, which provides a similar effect.

Can we do email tracking when sending email via smtp using php zend framework

Currently I'm using mailgun to send email, but planing to send email using smtp in zend framework php.
My main concern are:
Need to track the emails against open and click by recipients.
how can we send the emails in batch like for marketing emails or bulk emails?
is there any limit like only x numbers of emails can be sent using one Smtp authenticated configuration?
do we need to have user based SMTP settings to send email from those users or is it possible to have one common SMTP settings base same email domain for all the users to sent email from our application?
Mailgun have functionality for track your messages, more information you can find here. If you want to have your own mail server for sending your emails I don't have idea how to track messages unfortunately
I think best way to send bulk email messages is queue implementation. You can implement own queue or use something ready. Mails should be send by cron job to avoid blocking main connecting thread
Yes, mailgun has limits: Mailgun Pricing Page but if you wan't to send mails by your own server there are no limits.
You can have one account to send emails, it's not a problem

Send mail to a mailing list in php

My friend has got a e-commerce website where users can choose to receive mail with the new offers. So he asked to me to create a system to send them an email.
How can I with php send an email to all the people in the mailing list?
I know that editing the php.ini I can send mail from my personal email, like GMAIL, but it has a maximum number of mails for day.
So what is the right way?
The right way to do this is with SMTP.
http://www.jvfconsulting.com/blog/php-mail-function-vs-smtp-guaranteed-delivery/ explains that the standard php mail function sends mail, but your mails can be heavily blocked by anti-spam mechanisms of ISPs.
There are many prebuilt solutions, PHPMailer being one of them. Please see this link as well: send email using Gmail SMTP server through PHP Mailer

How do I run a PHP script when I get a new email?

I'm developing a web application which will send email notifications to users (including sender, subject, and message) if he gets new email in GMail. I can easily code for notification modules, but I don't know how to find and get emails. I'm having a free hosting account at x10hosting.com. I thought to create a email address in the mail domain of my x10hosting account and forward my emails to that address at x10hosting. Even if I forward it, how do I detect incoming emails and their counts, subject, message, etc. and how do I execute a PHP script which will take care of the notification module.
How about enabling the gmail account for pop or imap and using PHP to test that. You cant have a php web page that will automatically know - you will need to execute the script again and again to poll for new mail.
PHP really isnt the best solution for this.

Routing email from a desktop email client to php?

Lets take a look at the following scenario:
I have a websitesite, site.com. One customer support tech guy has an email account on it: techguy#site.com. Customers send messages to that email, tech guy replies via that email. They are both using desktop email clients (thunderbird, outlook...).
What I know is: using php to read incoming mail from customers
What I want to know is: how to use php to read outgoing mail that the tech guy is sending from his client via smtp, imap..
This would be used for archiving conversations between techs and customers without forcing them to use some php app on the site to send emails (I want them to use desktop clients).
I dont know much about email protocols, but I have plenty of experience in php. Im guessing that the email daemon could be setup to call a php script every time it recieves an outgoing email or something like that. Is there any way that this can be done?
The way how some products on the market are doing it is by requiring the user to install a plugin on his/her email client. Using this method doesn't matter what smtp server is used, the mails will be logged using the plugin.
Another way(this is just an idea) is to "force" the tech guy to use your smtp server so you can access the logs and see who sent mails and who is the receiver(accessing the logs using php)
It would be much easier to have a separate email address for logging purposes and simply keep it in the cc or bcc field for all communication between customer support and clients.
since you can have php interpret the emails, the best thing to do is have a dedicated email address that gets piped to a script (i know this is easy to set up cpanel)
you have the client email support#domain.com which gets piped to the script - do what you want with it there.
then you have the script email back out to bob#domain.com with a from address as support-reply#domain.com - which is also piped to a script
when he replies to that, it goes to support-reply#domain.com which goes to a script, which in turn you would process, then forward back out to the client#google.com with a return address of support#domain.com
i think amazon uses a similar technique so that people can email each other back and forth, but they create coded email addresses and have a database to keep track of who they are going to and coming from.

Categories