Jump to content

php e-mail


jakebur01

Recommended Posts

Is there a reliable way to have php process e-mails for a gmail account.  I need it to look at all the new e-mails that have VSI-FAX in the subject and run the code below to swipe out the failed fax number.  These are fax failure e-mails.

$pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i';
preg_match($pattern, $email_body, $matches);
$fax_number = trim($matches[0]);

 

Link to comment
https://forums.phpfreaks.com/topic/240900-php-e-mail/
Share on other sites

One way would be to use PHP's Curl library.

 

Here is an introductory Tutorial: http://phpsense.com/php/php-curl-functions.html

 

Here is a topic about logging into gmail via Curl: http://stackoverflow.com/questions/4748166/how-to-login-to-gmail-through-with-curl

the link that topic points to about using curl and the command line to check your gmail emails: http://www.commandlinefu.com/commands/view/3380/check-your-unread-gmail-from-the-command-line

 

 

I'm not familiar with the process myself, so I cannot give you any concrete code examples.

Link to comment
https://forums.phpfreaks.com/topic/240900-php-e-mail/#findComment-1237443
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.