Basicly what I'm trying to do:
1- login to Yahoo Mail.
2- getting mails (with both content and sender) into a string.
I'm able to send emails (from Yahoo Mail) by using phpmailer class. But I haven't done anything for reading mails. Also I couldn't find any useful information. Hope you can help me.
Yeah, use the Yahoo! Mail API.
To get the last three messages use this query
select * from ymail.messages where numMid='3'
http://developer.yahoo.com/mail/
Related
I want to show the notification in my web app whenever anyone will send the mail to my Gmail account.
I tried to do using IMAP, but IMAP is searching the mails based on the date. Like if I want to search mails from 11-10-2021 then it will give all the mails from 11th date to current date. But suppose I want the mails that comes after 11-10-2021 03:00 Pm, then it is not possible.
Any way to fetch the mails after particular time or based on the UID. Or is there any way to call the webhook whenever any mail receives in the Gmail account?
Note : I'm using the codeigniter framework.
Thanks in advance.
I think you need to do some settings in your Gmail
On the web
Open Gmail.
At the top right, click Settings. See all settings.
Scroll down to Desktop notifications and select New mail notifications on or Important mail notifications on (if you use Priority Inbox).
Click Save Changes.
let me know if this was useful
Okay then you need to turn on email notification in outlook
This video will explain everything.
https://youtu.be/Wvksb0VeQKk
Let me know if it helps
I want to develop an application that would extract the following things from an email id,
A notification about a new email
Subject
Sender
Total Unread emails
Now as I think it wont be easy to extract emails from all of the major email providers so I basically want to do it for Gmail.
I just need to find the way to do it. Please guide me. Thanks
It's actually fairly easy using the PHP IMAP extension. There are lots of functions there that you can use to list all emails in an inbox, get a count of them. Read their subjects or contents and such.
In GMail labels are the equivalent of folders in the IMAP docs.
You can connect to a GMail like this:
$mailbox = imap_open('{imap.gmail.com:993/imap/ssl}', 'email_address#gmail.com', $password);
Oh! Also you need to log in to GMail on the account you won't to allow email access to, go to Mail Settings -> Forwarding and POP/IMAP-> Enable IMAP
Documentation for the GMail API: https://developers.google.com/google-apps/gmail/
There will probably be some code monkeying involved in fetching the correct data, so I would recommend you to hire a nearby consultant doing it for you.
I am sending some mailings to a 5k list. I am not using any mailing commerce services. As expected I am getting some mails back from my mail-deamon and I would like to delete the those from the recipient-list. Is there a way to read the pop-mails programmatically?
is there maybe an easy and quick workaround?
A way to read POP mail via PHP: PHP: Download incoming email from POP3 or IMAP, parse it, and mark it as read/delete on server
(The code provided in the answer is using the functions suggested by Lèse majesté in its comment, but you find a ready to use small piece of working code thet does exacly what you need).
Obviously you will need to write also the code to programatically delete the address from your newsletter's DB.
I would use a cronjob (very easy to set on an hosting with cPanel) to programatically call the code that read the POP3 account and deletes the invalid addresses from DB.
A workaround? I don't know.
Can't you just set your "from" and "reply-to" address to an email address you can check? and then just check that email inbox to see what has bounced.
i want to have a script that will save gmail emails from an account in mysql db using php. Mails(both freshly new and reply ones) will be marked to be in the same category if they have the same subject. That is just the same way in gmail or yahoo mail.
So far as I know gmail IMAP does not give the facility to track which are the reply mails.
Which API or whatever should I use??
The script will keep running.
Do I need to use scheduled task for that?
I haven't worked with that, but as i Google around, it turns out GMAIL provides IMAP Extensions API. And there you have an option to Access to the Gmail thread ID: X-GM-THRID
The reply emails as you call them are stored in the sent-mail folder, so just download them with IMAP.
You can track how emails go together using the In-Reply-To: and References: headers. Using the subject is not reliable.
#sof_user : every mail will have message_id in the header. google tracing the email with the id, if it is reply, then IN-REPLAY-TO will have the same id.
I have a web app which needs to send emails to clients 'From' staff email addresses. What's the best way to prevent my messages from being flagged as spam?
For instance, if I own charles#gmail.com, I'd like to be able to send mail "From" that address with PHP in my App, without getting the "This message may not have been sent by...." message.
Right now I'm just using the mail() function within PHP, with Headers for the From, Return Path, and X-Mailer variables.
I'm generally pretty confused by everything I've read so far about SPF and DKIM, so I appreciate any advice. Thanks.
This is a very lengthy subject with lots of things to consider.
The most important rule is to not use HTML and to send only correct mails that people want, and that the recipients do not flag as spam theirselves.
For instance, if I own
charles#gmail.com, I'd like to be able
to send mail "From" that address with
PHP in my App, without getting the
"This message may not have been sent
by...." message.
If you own a gmail address you could just sent the messages via gmail's SMTP service, but keep in mind that gmail has a 500 email sent limit. Below is a topic describing how to use gmail's SMTP server with the popular PHPMailer.
Right now I'm just using the mail()
function within PHP, with Headers for
the From, Return Path, and X-Mailer
variables.
Outsourcing this is probably the way to go using for example:
http://sendgrid.com/
We also offer a Free Plan with 200
Email Credits per day.
To read pricing visit http://sendgrid.com/pricing.html
http://elasticemail.com/
No monthly committments, no minimums,
no limits. Just pay for what you use
at $0.001 / email or less.
http://aws.amazon.com/ses/
Email messages are charged at $0.10
per thousand.
http://aws.amazon.com/ses/pricing/
http://www.cloudsmtp.com/
http://postmarkapp.com/
Just to name a few which are very cheap to use without any hassle/setup.
If instead of using the mail() function, you use an SMTP mailer such as the PEAR mailer package then you can send the mail using google's own SMTP servers. This will require you to provide the correct credentials to the google account you wish to send from. This should avoid the issue you are having.
One of the first things you need to ensure is that the email "From:..." really is from your server e.g your_mailings#yourcompany.com and it must exist and be a valid email on the server where the script works. You should try setting the sendmail user at the top of your script (assumes Linux server):
ini_set('sendmail_from', 'your_email#your_server.com');
Then you add a "Reply-To:" header and use your staff addresses perhaps and recipients will at least seem to have got an email that can be replied to. Without that you probably won't even get as far as being spam, you will get blocked on the way there.
This thread shows some of that and note the comments on PHPMailer - it is a good way to handle mailing and I have found it more successful than simple mail();
PHP mail form isn't working