Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to send email from command line in F5

Viv_Richards
Cirrostratus
Cirrostratus

how to send email from command line in F5 ? I need to test whether OTP on email properly sent by F5 or not

 

5 REPLIES 5

Jad_Tabbara__J1
Cirrostratus
Cirrostratus

Hi Martins,

There are many ways to send mails from CLI.

Check following

https://tecadmin.net/ways-to-send-email-from-linux-command-line/

If you don't want to make change to your BIG-IP config. you can use the "telnet" option.

If you don't mind, you can first set the SMTP to use :

tmsh modify /sys outbound-smtp mailhub mail.mydomain.com:25

Then launch the following command to send a mail :

echo "test mail" | mail -vs "Test email for SOL13180" myemail@mydomain.com

Hope it helps

Please give us a feedback

Regards

James_Lim_28270
Nimbostratus
Nimbostratus

after keying the echo command. It says

 

bash: mail: command not found

 

i tested the same in both v13 and v15 , it worked fine in v13 but it didn't work in v15. same error message

youssef1
Cumulonimbus
Cumulonimbus

Hi,

you can use telnet:

https://tecadmin.net/ways-to-send-email-from-linux-command-line/

telnet localhost smtp

Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 fbreveal.com ESMTP Sendmail 8.13.8/8.13.8; Tue, 22 Oct 2013 05:05:59 -0400
HELO yahoo.com
250 tecadmin.net Hello tecadmin.net [127.0.0.1], pleased to meet you
mail from: sender@tecadmin.net
250 2.1.0 sender@tecadmin.net... Sender ok
rcpt to: myemail@ymail.com
250 2.1.5 myemail@ymail.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
Hey
This is test email only

Thanks
.
250 2.0.0 r9M95xgc014513 Message accepted for delivery
quit
221 2.0.0 fbreveal.com closing connection
Connection closed by foreign host.

James_Lim_28270
Nimbostratus
Nimbostratus

I am using gmail/O365 server. Hence telnet would not be applicable