read forwarded emails header and body in php - php

In my mail box, I got bounced emails which are forwarded from other server.
When I check show source from mail application, it gives me all custom headers which I want.
So I want to read original source to get all headers.
I checked out imap_fetchheader, imap_body etc but it did'nt worked out for me.
Is there a way to get text of show original source of email using code?

Related

php imap: can't see actual recipient if bcc

I'm working with PHP IMAP functions to poll an inbox and process the emails. Sometimes the emails are received via bcc -- this email was bcc'd by the sender. I need to be able to retrieve the actual email bcc'd -- but imap_fetchheader and imap_rfc822_parse_headers don't provide that if the recipient is bcc'd (even though it's in the return spec).
The issue is that I'm using plus addressing (myemail+value#domain.com) as part of my script, so it's not sufficient to know the email landed in my inbox -- I need to know the specific version of the address it was emailed to.
I understand the whole purpose of bcc is to be hidden. But I would think that there should be something in the header of the bcc-recipient to indicate the email was sent to them.
The "bcc address" that message is sent to is not part of the message itself, it is part of the message exchange protocol. It is used on the protocol level of smtp whilst handing over the message to the receiving server. The content that is handed over, so the message payload itself, is something different. There is no way to read that address from a received message by means of a protocol like imap4 or pop3. You'd have to scan and parse the smtp servers log files for that.
You can easily check that yourself: open the source code of a message received. So the original, technical payload including everything. That looks ugly, but it shows all information actually contained in the data. You will not see any mentioning of "bcc" or a "bcc address" in there.

Adding an image in email headers PHP

I want to add an image in the mail headers just like Youtube has when I receive an email from them. I'm simply using the php mail function to send emails, but I can't figure out how to implement this. Am I thinking it wrong?
Here is the final result I want
Thanks for your time,
Felix
You can pass HTML as body in your email.
The only problem is that outlook does not support it.
But all you have to do is build your email body in html and send it using PHP.
For the header it looks more like an tag or something, maybe it's not send via PHP. you could check out software like mailchimp.
P.S. make sure your image is hosting somewhere because you can't access it localy.

Using my websites link in a href is preventing me from receiving my message

I am trying to send a message using php mail fucntion. This is a part of the message that is causing the issue.
a href="http://www.MYWEBSITE.com">Visit
Mail is returning with a 1 but I am not seeing the message in my inbox. If I change it to
a href="http://www.google.com">Visit
I receive the message in my inbox.
Any Ideas?
This will give you a list of what's spammy in your MIME header and html content, or if your sender isn't trusted. It mainly checks against SpamAssassin, which has most of the rules of other email filters.
http://isnotspam.com/

Adding gmail quick actions to email (via phpmailer)

So, I am trying to add a go-to-action button/label for emails for gmail customers in their inbox (see https://developers.google.com/gmail/actions/reference/go-to-action).
The email is sent via phpMailer.
I have successfully tried the example implementation for the view action within scripts.google.com. Unfortunately the example code won´t work for any email I am trying to send via phpMailer.
So far, I have checked the email markup successfully at https://www.google.com/webmasters/markup-tester/ without any errors.
After viewing the original sent email files I only recognized that the email is sent as text/plain and as text/html. Does anyone have the same issues? Any suggestions what might be wrong? Thanks in advance!

Php Mail() email sent to Comcast.net Address POP3ed to Outlook not displaying HTML Format

This is sort of a complex issue, hopefully you can help.
I am using php mail() to send an HTML formatted email of blog content (an "email to a friend" option sends post content to a user supplied email address).
I am having an issue with Comcast.net email addresses.
The HTML formatted email comes through correctly when viewed on Comcast.com's internet mail, but when POP3ing it to outlook, the html format is stripped and the user gets only the html code.
So, when an HTML formatted email is sent to a comcast.net address and then pulled to outlook via POP3 the HTML format is stripped and only displays the html code.
One interesting thing to note it that when viewing the email on Comcast.com's mail viewer the from line is present, but after being pulled into Outlook the from line is blank.
I have tested this with other accounts, gmail, aol, yahoo, and these all POP3 to outlook correctly, it is specific to Comcast.
Anyone have any ideas why this would be happening?
[UPDATE]
I removed the "\r" from the header information (as suggested here) and it corrected the format issue
Can anyone shed light on this?
Thanks!
I removed the "\r" from the header information (as suggested here) and it corrected the format issue.
Hope this helps everyone.

Categories