sending email to office 365 email using smtp - email

I have a contact form built with Laravel, and I want to send an email to my company email which is hosted from office 365 and my website hosting is Cloudflare
this is the env file configuration
MAIL_MAILER=smtp
MAIL_DRIVER=sendmail
MAIL_HOST=smtp.mail.yahoo.com
MAIL_PORT=465
MAIL_USERNAME=xxxxxxxxxx#yahoo.com
MAIL_PASSWORD=xxxxxxxxxx
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=mxxxxxxxxxx#yahoo.com
when I send an email using a contact form the email never receives to company email and when I try another receiver like yahoo or Gmail the message is delivered fine.
do any one know why i can't receive emails in my company email.
I have tried mailtrap testing and every thing was fine

I have fixed the problem, Cloudflare needs to add records to the domain to be authenticated by office 365
https://community.cloudflare.com/t/need-help-with-office-365-error/80501/4

Related

How does an SMTP server resolve ambiguity?

Suppose I own an email 'demo#gmail.com'. Now, I create a new Microsoft account using my existing email. Thus I get another email 'demo#gmail.com', but this one is served by Microsoft.
So the situation is: one email and two providers.
If I send a hello email to 'demo#gmail.com' using my personal SMTP server, to which of the above will it send: will it send to the one hosted by Microsoft or the one hosted by Google?
How does it solve such an ambiguity? What are the factors that influence this?
This is a very common problem because many providers are giving us an option to create a new account using our existing email.
My observations:
I saw the emails inside the inboxes of both the services. I found that they had completely different emails.
There was no email which was common to both the inboxes. So there must be some mechanism to deal with it.
Let us look at the problem the other way round: If I had an email 'demo#outlook.com' initially and I created a new Google Account with this email address, then:
An email sent to this email address from another gmail account goes to the Google's server. An email sent to this email address from an Outlook also goes to the Google's servers.
There are two different ways of looking up an email. The 'normal' way:
You send an email to an server, in this example gmail.com.
Your mail delivery agent looks for mx record of gmail.comand send it to the ip-address of gmail.com.
If an email is delivered locally by the domain outlook.com it perhaps doesn't lookup the mx record, but lookups in a local database if the email-address exist there, and sends it to the ip-address of the outlook.com.
I think in the inbox of outlook.com are only microsoft emails.
More details can be found at https://www.socketlabs.com/blog/smtp-email-delivery/

Godaddy email forwarders not working when sending from php mail

I have an email forwarder set up on my GoDaddy account, which works fine when sending from an individual email account, but when I sent to it from a PHP script, it never gets received.
Here are a few additional details (I feel like the first two items here might be key in figuring out the answer):
The email forwarder is on a GoDaddy account with a domain name. The Website for this domain name is hosted on another godaddy account. The nameservers set on the Domain name account are the default name servers (The website is working properly, because both accounts are GoDaddy).
I have tried setting the email forwarder up on the hosting account instead of the domain name account. Interestingly, the email then does receive emails from php mail, but it does not receive emails sent directly from an email account. Instead, I get the error message "Your message wasn't delivered to name#xxx.com because the address couldn't be found, or is unable to receive mail."
I can successfully send an email to any other email account from the same php script, so the problem is not my php mail function
I had made some changes to MX records at one point, but then changed them back. A GoDaddy support tech said that they were correct and should work
I've spent lots of time with Godaddy support, they said that they can not help me since the email forwarder is "working" when sent from a regular email account.

Not able to send mails to the same domain using SendGrid api

I'm using the SendGrid API to send the mail. It is working fine if, from and to domains are different. But it is not working if both from and to domains are same.
If the sent "from" email address' domain name is #yahoo.com or other large email provider, then all "DMARC" compliant mail servers will bounce the email unless the email was originated from the email provider's mail servers.
Otherwise, their should be no issue with sending emails where the "from" and "to" domain is the same.
For reference, this is yahoo's DMARC policy currently (as of 2/5/2019):
(https://help.yahoo.com/kb/SLN24050.html)
Yahoo recently updated the DMARC record with "p=reject" for Yahoo domains. This was done to protect our users from increasing email spam that uses Yahoo email addresses from other mail servers.
All DMARC compliant mail receivers (including Yahoo, Hotmail, and Gmail) are now bouncing emails sent as Yahoo email addresses that aren't sent through Yahoo servers.

Joomla 2.5 emails not received

I have a joomla 2.5 website that has a 3rd party extension to send a contact form.
The contact form has three email address' set up as recipients, two of them are the same as the domain ( www.domain.co.uk and info#domain.co.uk ) and the other is my email address.
I receive the email with the completed contact form however the other two address' don't receive anything.
Before I migrated this site I had the same problem, the current working email address didnt receive anything but others did. Again before site migration the domain and email address were the same.
The client has checked there junk/spam folder and the email address is currently receiving other emails.
I haven't tried SMTP yet as I would have to get the info from a client.
Any other suggestions? Do you think SMTP would resolve the issue?
It is mail configuration on server - many times it´s sends mails without smtp credentials to "self domain" or domains housted in same server, but not outside.
Yes smtp configuration has to resolve this issue.

Use mailgun to send from existing domain

Last week I tried to configure our application to send mails using mailgun. I added the txt and cname records for mg.mydomain.com.
But what I actually want is to send on behalf on an email like user#mydomain.com and not the mg.mydomain.com subdomain.
So I changed the 'From' address to user#mydomain.com. After a while I noticed 5% of my mail got bounced back because of some spam filter. Probably because there weren't any MX records on the mg.mydomain.com domain.
The user#mydomain.com is used by outlook 365. All mail send to us should be delivered at the outlook 365 server, not mailgun.
So the perfect situation for me would be to:
Send from outlook 365 as user#mydomain.com.
Send from mailgun as user#mydomain.com
Receive at outlook 365 (like it is set up right now)
What I'm afraid of is when I'm sending an email from mailgun it still won't get through the spamfilters because the outgoing server (mailgun) is different from the server my MX record points to (outlook 365).
Could anyone confirm this or is this not a problem when setting up extra txt and cname records for mydomain.com?
You probably use DNS to set up a TXT record in which you state which servers your mail is allowed to come from. (SPF-record). Does this include both the Mailgun servers, and the Office 365 servers?
You probably also set up DKIM to sign the outgoing e-mails. Mailgun automatically signs the e-mails it sends using the DKIM setup. I'm not sure about Office 365. Perhaps the e-mail is being rejected because Office 365 does not sign your e-mails, or perhaps Mailgun and Office 365 both sign the e-mails using different private keys (this is likely), but only one of them has a public key defined in the DNS server (don't know, could be).
As long as you don't set your MX records to something done by Mailgun, you can receive all you want.