Unable to send email to office 365 via linux command - linux

I am trying to send email via linux command line using following command
echo "This is body part" | mail -s "this is subject" username#domain.com
If I send to gmail it works but if i send to office365 it does not work.
Could you help me?

This can also quite often be because of the mail relay server you are using (where the SMTP mail is routing through from the Linux box) not having been set up properly with public RDNS records. Many mail servers reject mail that comes from a domain without the appropriate RDNS configuration.

User checklist for "non delivered messages"
Checked Junk/Spam folder in the receiving mailbox.
Check sender mailbox for bounce (delivery problem report) mail messages.
You may receive first "warning email" after a few hours (e.g. 4h) of failing delivery attempts.
Some botched anti-spam system throw away messages "classified as spam" without any hint to the sender or the recipient -> ask admin/postmaster of the receiving mail server

Related

PHPMailer bounce email address shows in sender mailbox

I am using a PHP script to send emails using PHPMailer (on an ovh web server).
With the following script :
$mail->isMail();
......
$mail->addReplyTo('postmaster#mydomain.fr', 'Site');
$mail->SetFrom('postmaster#mydomain.fr', 'Site');
Emails get delivered to my gmail account BUT not to other addresses (e.g. my Business email).
With the following script :
$mail->isMail();
......
$mail->addReplyTo('postmaster#mydomain.fr', 'Site');
$mail->Sender = 'postmaster#mydomain.fr';
Emails get delivered to other addresses (e.g. my Business email) BUT not to gmail.
Also the sender appears as
bounce-id=D004=U58180. …… .net
which is not so friendly.
Is there a way to solve those issues ?
Using setFrom by itself will result in Sender being set to the same value as your from address (look at the code in the setFrom method). So in your second example you're setting the envelope sender, but not the from address, which is likely not what you want.
You may find it easier to use SMTP to localhost instead of isMail(); just changing that method to isSMTP() should be enough to do that. That way you can set SMTPDebug = 2 and see exactly what your local mail server is saying.
Separately, you don't need to set a reply-to address if it's the same as your from address – PHPMailer will simply ignore it if you try to set them to the same value anyway.

phpmailer forces Mail delivery failed to reply-to and not from

I'm using phpmailer on my ERP and the from email is a noreply# and the reply-to is my client/company email.
Sometimes I'm receiving "Mail delivery failed: returning message to sender" that is normal but I'm receiving those to my noreply# and not the client email.
How can I force the phpmailer to send the "Mail delivery failed" to reply-to email?
Thank you for your help.
Bounces go to the return-path, not the reply-to address, because they are bounces, not replies.
It's not PHPMailer that's sending your bounces there, it's the receiver, and they are acting correctly.
You can set the return path indirectly using the Sender property which is used to set the envelope sender, which the receiver converts into a return-path before attempting delivery. Do not be tempted to set a return-path header yourself; it's the receiver's job.
$mail->Sender = 'bounces_go_here#example.com';
Beware though – this address is what SPF applies to, so you need to be very sure that your SPF records are set up correctly. For reliable bounce handling, I'd recommend making use of VERP addressing here too.

SendGrid/Outlook receiving 50% of emails

I've just set up SendGrid, authentificated my domain and did the sender verification.
I use Node.js to send email via the API.
When I make a test, the mail is sent to my outlook address. It takes 3 seconds to appear in Outlook, not in spam, in my inbox.
However, when I make the same test, 30 seconds later, the mail is processed by SendGrid, but I never receive in Outlook..
How can it be possible ?
please check your sendgrid activity tab. Processed doesnt mean that outlook received it. After processed there is another level of delivered. Does it say in your sendgrid activity log that it was delivered. It might say not and outlook refused it because they think one email after the other might be spam. (Keep this in mind when sendgrid sends emails it doesnt come from your email address, and some might mark that as spam)

Limesurvey notification emails will not send

I've recently noticed an issue with my Limesurvey installation. Until recently, I had a number of surveys set to email the user after submission (using {email} in the "Send detailed admin notification email" box to refer to an email question in the survey). However despite not manually changing anything, they no longer send. Some others do send from within limesurvey, for example from the "Create new admin" option, while token related emails will not.
In the case of token invitations, the debugging there will say emails sent when using php, but the test emails never arrive (multiple emails tested). When using SMTP, I get the below:
SMTP connect() failed... Some emails were not sent because the server did not accept the email(s) or some other error occured.
I should note that while I first noticed this in existing surveys in version 2.73.0, I've since done a fresh install of 3.1 and created a test survey. So this is pointing at a server config issue, but I haven't had any issues with emails sending except in this specific case.
Any suggestions of particular places to look would be much appreciated!
Did you try to change the email method in settings (https://manual.limesurvey.org/Global_settings/en#Email_settings)?
Email method: This determines how emails are being sent. The following options are available:
PHP (default value): uses internal PHP mail function
Sendmail : uses sendmail mailer
SMTP : based on SMTP relaying. Use this setting when you are running LimeSurvey on a host that is not your mail server
Make sure that you are using your SMTP configured email (Global settings -> Email settings) if you use SMTP, otherwise there might be a chance that the following error is displayed: 'SMTP -> ERROR: RCPT not accepted from server: 553 5.7.1 : Sender address rejected: not owned by user'
Qmail : Set this if you are running the Qmail mailer

Check if email exist with emailjs in node js

I'm trying to use the emailjs (https://github.com/eleith/emailjs) for sending emails in nodejs.
I want to check if email exists before sending it and I do not want to send an email to know this.
So, My question is: How to check if an email address exists on the remote server?
At the network level, receiving and sending email are different operations. In a typical email client (like outlook or a wwebmail program) they appear integrated, but that is an elaborate illusion.
Your question mentioned a npm module to use SMTP to send emails. That's the way email clients do it.
Email clients use the POP3 protocol and sometimes the IMAP protocol to read messages from mailboxes on email servers. Some npm modules handling pop3 are available for node.js, and you can use one. But you will have to create the code to "know this email exists" as you put it in your question. You will read emails from the mailbox -- all of them! -- and examine them for the information you need to "know this email exists." If the inbox you read also belongs to a person, you need to be careful to tell POP3 to leave the messages on the server.

Resources