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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.