Forum Discussion

Viv_Richards's avatar
Viv_Richards
Icon for Cirrostratus rankCirrostratus
Oct 03, 2017

how to send email from command line in F5

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

  • 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

    • Abed_AL-R's avatar
      Abed_AL-R
      Icon for Cirrostratus rankCirrostratus

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

  • 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.