Why email layout is different in yahoo and gmail - php

I have a cakephp Shell programme that send email to users but my in Yahoo email is fine but in gmail it looks bad.
Any help?
Thanks

The set of css rules supported varies greatly for different email clients. So to ensure consistent display you should use only those rules that are supported by all (or most) clients. You can check the list of css rules supported for popular emails client here https://www.campaignmonitor.com/css/

Related

How to preview an HTML email in various email clients before sending it. PHP/Javascript

I have developed a web app which is sending HTML email using PHP. I would like to let the user be able to see what the email will look like in various email clients (Outlook/Gmail etc) before sending it out.
I searched, but I could not find any plugins that would let me do this.
I found the Litmus email preview API which would work, but it is too expensive. Is there any website that has a similar API for a cheaper price or free that I can use? Or is there any way I can do this myself without the need of some other website.
To send bulk emails to clients, I use "poMMo" (https://github.com/soonick/poMMo), it allows you to view the email and even receive an email test, before sending it to the clients.

How does GitHub 'Reply by Email' work?

I notice that a lot of websites like Facebook and GitHub allow you to reply to an email notification which then posts the reply back to the application using a unique Reply-To address. How does this work on the back-end? I searched a lot but, only found that people were using unique Reply-To addresses. That's understandable but, what do they use to receive these emails? Do these companies set up email servers? I am trying to build this using PHP.
A common method is to set unique message ID's in the outgoing email and then looking at the In-Reply-To header to see which email this was in reply to. That lets you match up your server application's messaging system to emails. For example, if you send an email that represents a help desk ticket with ID 1234, the Message-ID could be something like
ticket-1234#myserver
Then, in email clients that work nicely (I'm looking at you Android), when you hit Reply, the reply has the header In-Reply-To: ticket-1234#mysever. You can go further by adding security tokens to ensure people can't forge messages (e.g. ticket-1234-hf29e9f2gf2e9fh29f#myserver). That security token is generated on the server when you send your first message and is then confirmed in the reply.
This normally works but can cause real headaches when email clients don't behave as they should!
This is how GitLab manages emails by using an identifier in the email address itself and catching it when the user replies. Although it is not relevant to any scripting language like PHP and uses server configs, this is what backend servers do to support reply by email functionality.
You have to set up a mail server to receive mail answers.
SIEVE filters on a IMAP server could be use to make some actions when a certain filter is detected.
But you can't only use PHP to make that type of system.

email hyperlink allow user to choose email client

On some websites when I click the contact email link, I get either a list or some icons for common email programs like gmail, yahoo, hotmail, etc., and I can pick which email program I want to open, then the email program opens and fills in the To: and Subject: fields. I can't find any web pages to show as an example, but I have seen it sometimes with Craigslist. Does anybody know how to code for this?
You can populate subject and body - in most e-mail clients - like this:
E-mail
This is usually a far better solution than making the user pick their provider and relying on an undocumented and subject-to-change URL format of some sort, not to mention it works with desktop clients like Outlook.
viewing source on craigslist you can see the urls; this is gmails:
https://mail.google.com/mail/?view=cm&fs=1&to=TOADDRESS&su=SUBJECT&body=BODY&tf=1&shva=1
you want to check each sites documentation for the particulars

Gmail / yahoo threading email including attachment

Is there a way to force gmail / yahoo in threading emails with the same subject?
Here's what happened with the email that i sent.
Yahoo - the second email is combined with the first email including the attachment.
Gmail - The second email is empty and no attachment. The body was replaced with "Important mainly because of the people in the conversation."
I am not sure if threading is causing this problem. is there any way to fix this?
Yahoo and Gmail detect if the e-mail is in the same context. So a similar body, and same subject.
if you make an e-mail more specific (different contents) it should not make it a thread.
But Threading should not cause the loosing attachment problem. You should dig deeper on that, by looking to your own code.
It is not possible that your contents go away just like that. In Gmail you can disable threaded view in settings, and I am not sure about yahoo, but it should have options for that

sending an html email from php

I making a newsletter for my users and would like to send it using my php.
I use the mailer function which works fine. My problem is as follows.
the email does not appear as it should on gmail and hotmail and this only on the web version. If I use outlook or mail to view the email, then CSS is applied. but when i view the same email on the web, the css seems to be removed.
Any idea as to what I should be doing?
my second question is about the structure of the html email itself. should it have the html and body tags? or would just divs be enough?
would you recommend using tables for the layout, as i have noticed some newsletters using them? maybe that is a better alternative to floats ( for html email only)
Thank you for your help
E-Mail clients do not support the whole spectrum of HTML/CSS features that are supported by today’s web browsers.
See the following for further information:
Email Standards Project
Guide to CSS support in email clients
Gmail's web UI strips all <style> tags.
It should be a completely self sufficient html document with styling included and all paths (links/images/etc...) should be complete paths.

Categories