I'm trying to send an email using smtp-relay.gmail.com as a relay server, but when I try to use the 'Mail From:' command, I get this error:
c: mail from: username#google.com
s: 555 5.5.2 Syntax error. f23sm825435wmf.2 - gsmtp
use brackets <> (some mail servers does not require this)
MAIL FROM: <user#example.com>
Related
We have a GITLAB setup and
We want to send the output of a error file as a attachment and giving a proper message including in the body as a mail notification to the recipients using BLAT as a service. Using below code
blat -subject "IP is not pingable" -body "please check the attachment for the error logs" -attach C:\Temp\error.txt -to santoshkumar.angadi#yahoo.com
We want to send this from the GITLAB. But I am getting BLAT error log as :
Error: Not a socket for a SMTP server. How to achieve this
Specify an SMTP server with the -server <address>
See http://www.blat.net/syntax/server.html
Make sure it's one that blat can connect to.
As http://www.blat.net/?docs/readme.txt says: To use Blat you must have access to a SMTP server via TCP-IP
I am trying to configure email but getting following error.
when running task getting following error: -
I am using Python3 with airflow 10.3 versions in GCP Composer need help.
My airflow.cfg
[email]
email_backend = airflow.contrib.utils.sendgrid.send_email
[smtp]
smtp_host = smtp.gmail.com
smtp_starttls = True
smtp_ssl = False
smtp_user = airflow
smtp_port = 587
smtp_password = mypassword
smtp_mail_from = myemail#gamil.com
in my dag file I have created task :-
dag.py file:-
from airflow.operators.email_operator import EmailOperator
email_task=EmailOperator(task_id='email_task',to="email#gamil.com", subject="test", html_content="<h1>Most important heading here</h1>", files=None, cc=None, bcc=None, mime_subtype='mixed', mime_charset='us_ascii', dag=dag)
Getting error:
ERROR - HTTP Error 401: Unauthorized
python_http_client.exceptions.UnauthorizedError: HTTP Error 401: Unauthorize
The error is an Authorization error, so you need to check that you're setting your Sendgrid API Key (or password, if using a smtp-server) correctly.
Based on your airflow.cfg, it seems to me that you are trying to use both Sendgrid and a third-party smtp server.
The email flag determines which one to use. In this case, the flag email_backend = airflow.contrib.utils.sendgrid.send_email is specifying that you are going to use Sendgrid.
To configure Sendgrid as your email server, you need to obtain your SENDGRID_API_KEY and set both the key and SENDGRID_MAIL_FROM as environment variables.
On the other hand, if you want to use another smtp server, you have to change the email flag to email_backend = airflow.utils.email.send_email_smtp. In this case, you need to override the smtp user and password.
With Google Cloud Composer, you must set the:
SENDGRID_MAIL_FROM
and the:
SENDGRID_API_KEY
Composer "ENVIRONMENT VARIABLES"
How can I check failed mails. Swiftmailer is returning true even if i supply invalid email address. I need to log send and failed mails into database
$message = Yii::$app->mailer->compose();
$message->attach($protocal.$_SERVER['SERVER_NAME'].$payslip);
$message->setTo("tft#sjkdsjk.dfdh");
$message->setFrom("hr#gmail.com");
$message->setSubject($vStaffName." ".$vPeriodName. " Payslip");
$message->setTextBody("Find attached copy of your payslip. To open this document use your ID number as password");
$send = $message->send();
var_dump($send);die(); //returns true always
I would expect true or false
You should check with SMTP.
That means you have to connect to that email's SMTP server.
After connecting to the SMTP server you should send these commands:
HELO somehostname.com
MAIL FROM: <no-reply#gmail.com>
RCPT TO: <emailtovalidate#domain.com>
If you get " Relay access denied" that means this email is Invalid.
There is a simple PHP class. You can use it:
http://www.phpclasses.org/package/6650-PHP-Check-if-an-e-mail-is-valid-using-SMTP.html
Error message: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM
Apache ActiveMQ 5.15.0 -
Apache Camel 2.19.1 -
JavaMail version 1.4.7 -
--mailer.properties
camel.smtpserver=smtp.office365.com:587
camel.smtpUser=xxx#xxx.com
camel.smtpPassword=xxx
camel.smtpfrom=xxx#xxx.com
camel.smtpto=xxx#xxx.com
xxx#xxx.com: a valid office365 account
--Camel.xml
<to uri="smtp://{{camel.smtpserver}}?password={{camel.smtpPassword}}&username={{camel.smtpUser}}&mail.smtp.auth=true&mail.smtp.starttls.enable=true&from={{camel.smtpfrom}}&to={{camel.smtpto}}&contentType=text/html"/>
-- Thanks for your help !
You can try to modify your url like below
smtp://{{camel.smtpUser}}:{{camel.smtpPassword}}#{{camel.smtpserver}}?mail.smtp.auth=true&mail.smtp.starttls.enable=true&from={{camel.smtpfrom}}&to={{camel.smtpto}}&contentType=text/html
The presence of a # character in the user name can also be critical.
I can send emails from a linux server by typing the following on the console, without any issues:
mail -s "Test Subject" testemail#gmail.com < /dev/null
I try to send it via a Java app, using javax.mail via:
public void sendMail() throws MessagingException
{
final Properties p = new Properties();
p.put("mail.smtp.host", "localhost");
final Message msg = new MimeMessage(Session.getDefaultInstance(p));
msg.setFrom(new InternetAddress(from));
msg.addRecipient(RecipientType.TO, new InternetAddress(to));
msg.setSubject("Test");
msg.setText(body);
Transport.send(msg);
}
but I get a
Causing: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1
error, is this due cause I need to replace
p.put("mail.smtp.host", "localhost");
with my server's address? if yes, where can I find what I should put there?
Thanks!
Do you have a mail server running on your local machine?
Have you configured sendmail to route messages to your mail server?
If you run "mail -v ..." it should tell you what the mail command is doing to send your message.
But yes, most likely, you want to configure JavaMail to connect directly to your mail server, which is probably not running on your local machine. You'll find more help in the JavaMail FAQ.