
Send an email from the command line
Sending mail from your *nix account
Sending mail through your ISP
Add headers
Merging the two previous methods
Send emails without using netcat
Sending mail from your *nix account
Sending mail through your ISP
Add headers
Merging the two previous methods
Send emails without using netcat
Send an email from the command line
Sending mail from your *nix account
In the first case you will need on your machine a running mail server like postfix, sendmail or other...Now to send an email from your user on your machine to another user on another machine.
To do this enter the following code:
mail recipient@email.com Subject: mail test from command line Here is the content of the mail the second line of content...
To send a message to another user in the same local machine, simply enter his username instead of email address.
Sending mail through your ISP
Send an email via your ISP allows you to specify more the email address of the sender. It is very easy to spoof an email address that way. Attention spoofing is prohibited and your actions leave traces.To send this email we use 'netcat' or 'telnet'. At first retrieve the address of the mail server of your ISP.
Enter then the following command:
nc smtp.yourISP.com 25
ehlo bob
MAIL FROM: <sender@server.com>
RCPT TO: <recipient@server.com>
DATA 354 End data with <CR><LF>.<CR><LF> This is the body of my mail. .
Add headers
It is possible to add headers in the message body to specify the date, subject, send a copy...Merging the two previous methods
You can simply, when you email daemon is running on your machine, talk to it via 'telnet' or 'netcat'.hanoo@hp_laptop% nc 127.0.0.1 25 220 hp_laptop.localdomain ESMTP Postfix EHLO man 250 hp_laptop.localdomain MAIL FROM: <netcat@postfix.com> 250 2.1.0 Ok RCPT TO: <target@host.com> 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> This is the body of my mail, this is the second line... . 250 2.0.0 Ok: queued as 9C12E7F404
Send emails without using netcat
Know that 'netcat' and 'telnet' are available in windows, linux and mac and that in android you have 'telnet' which works the same way for this purpose as 'netcat'.It should be noted that it is also possible to use '/dev/tcp' in bash and 'TCP_Send' in zsh.
alert(1)
alert(1)