Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. read -p "Enter Recipient's Mail Server: " server
  4. read -p "Enter SMTP Port: " port
  5. read -p "Enter Your Email Address: " from
  6. read -p "Enter Recipient's Email Address: " to
  7.  
  8. # create message
  9. function mail_input {
  10. echo "ehlo $(hostname -f)"
  11. echo "MAIL FROM: <$from>"
  12. echo "RCPT TO: <$to>"
  13. echo "DATA"
  14. echo "From: <$from>"
  15. echo "To: <$to>"
  16. echo "Subject: Testing SMTP Mail"
  17. echo "This is only a test. Please do not panic. If this works, then all is well, else all is not well."
  18. echo "."
  19. echo "quit"
  20. }
  21.  
  22. mail_input | netcat $server $port || err_exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement