Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the email text #8

Open
glena opened this issue Feb 6, 2014 · 4 comments
Open

How to get the email text #8

glena opened this issue Feb 6, 2014 · 4 comments

Comments

@glena
Copy link

glena commented Feb 6, 2014

Hi, we are trying to implement your class in our code to check bounces but we are getting the following error:
#0 /vagrant/leads/cron/bounce/bounce_driver.class.php(500):
#1 /vagrant/leads/cron/bounce/bounce_driver.class.php(431): BounceHandler->standard_parser
#2 /vagrant/leads/cron/bounce/bounce_driver.class.php(107): BounceHandler->parse_head
#3 /vagrant/leads/cron/bouncemailparser.php(36): BounceHandler->get_the_facts
#4 /vagrant/leads/cron/bouncemailparser.php(74): BounceMailParser->run

To get the emails we are using imap_open in the following way:

$conn = imap_open($host, $user, $pass, OP_SILENT) or die(imap_last_error());

$num_msgs = imap_num_msg($conn);
$email_addresses = array();
$delete_addresses = array();
for($n = 1; $n <= $num_msgs; $n++)
{
$bounce = imap_fetchheader($conn, $n) . imap_body($conn, $n); //entire message
$multiArray = $bouncehandler->get_the_facts($bounce);
}

@cfortune
Copy link
Owner

cfortune commented Feb 6, 2014

//To feed the parser a properly formatted MIME email, make sure there is a double line return between the header and body.
$bounce = imap_fetchheader($conn, $n) . "\r\n" . "\r\n" . imap_body($conn, $n); //entire message

@glena
Copy link
Author

glena commented Feb 7, 2014

No, still the same (I replace my line with yours).
Is there a better way to get the emails than imap_open that works better with your class?

@cfortune
Copy link
Owner

cfortune commented Feb 8, 2014

That should have worked. You should examine the contents of the $bounce variable to see where it went wrong.

You will need to start with a plain text email. Each and every email is saved as a file on the mail server. Talk with your server admin about how to access those files.

@glena
Copy link
Author

glena commented Feb 8, 2014

I will check this variable.
The issue is that we are using google apps :(

Germán Lena

Sent from my mobile. Please excuse the brevity, spelling and punctuation.
El feb 8, 2014 8:13 PM, "cfortune" [email protected] escribió:

That should have worked. You should examine the contents of the $bounce
variable to see where it went wrong.

You will need to start with a plain text email. Each and every email is
saved as a file on the mail server. Talk with your server admin about how
to access those files.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-34559586
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants