Using BLAT service in GITLAB - smtp

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

Related

Forgot password system using Gmail & Laravel 8

I am using built in Laravel 8 login system with its scaffolding have a project that has a forgot password for its login system which sends emails from requests. I'm trying to use Gmail and XAMPP for sending the email. I am unable to send an email using the Gmail account, So I tried configuring my .env and other configuration files in XAMPP. But I get the following error upon sending the request
Swift_TransportException
Connection could not be established with host smtp.googlemail.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
Could someone tell me why I'm getting this error and what should I do to get rid of this? Thanks a lot.
<**env**>
MAIL_MAILER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=587
MAIL_USERNAME=********#gmail.com
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=********#gmail.com
MAIL_FROM_NAME="${APP_NAME}"
<** php.ini**>
inside xampp\php\php.ini under the function under the tab [mail function]
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = ******#gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
<**sendmail.ini**>
inside xampp\mail\sendmail.ini under the function [sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=*******#gmail.com
auth_password=******
force_sender=*******#gmail.com

Getting error while sending email from GCP composer airflow

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 log failed mails into database using swiftmailer

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

SMTP Mailgun Throwing Error with Mastodon

I'm currently trying to run a mastodon server I've installed everything correctly and I haven't gotten an error till now
I'm setting up my SMTP this is the info I've put in
SMTP server: smtp.mailgun.org
SMTP username: mastodon#notifications.example.com
SMTP password:
SMTP authentication: plain
SMTP OpenSSL verify mode: peer
Then when I try to send a test e-mail it throws this error
E-mail could not be sent with this configuration, try again.
SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)
Ahh! So someone just pointed out on this thread (https://mastodon.social/#slackz/99772551531768277) that authentication SMTP_AUTH_METHOD and SMTP_OPENSSL_VERIFY_MODE should be commented out in the config. The mastodon:setup rake task automatically adds them (gonna look into making a PR to change that), but if you:
comment out the two lines in .env.production with the above env variables
ensure all your mailgun account records are verified, that you can send email with a curl command they supply on their site
restart the mastodon processes:
sudo systemctl restart mastodon-*
Opened an issue about the behavior here:
https://github.com/tootsuite/mastodon/issues/6975

SMTP mail error

Hello i have some problem when using SMTP mail using PHP.
when i am use mail function that time always it shows
errore Like "Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?"
How can i slove this problem at (Project is on Cpanle)
Kindly help me
It would help to see a code snippet.
The error message suggests that you are using fsockopen() and passing it an http URL instead of an hostname.
You may also have an http url somewhere else (in your code or a config file) that is passed to fsockopen() at some point. Make sure your smtp server hostname doesn't start with http://.