pantz.org banner
Send mail through an SMTP server using telnet
Posted on 02-23-2003 02:13:00 UTC | Updated on 02-23-2003 02:13:00 UTC
Section: /software/smtp/ | Permanent Link

This is quick writeup which describes connecting to a mail server and sending a test message using telnet.

Telnet to the mail server.

telnet mail.somedomain.com 25

You should recieve a reply to this effect.

Trying 10.10.10.10...
Connected to mail.somedomain.com.
Escape character is '^]'.
220 mail.somedomain.com ESMTP Exim 4.04 Wed, 13 Nov 2002 16:27:42 -0700

Then send your HELO command.

HELO mail.someotherdomain.com

You should get back something to the effect of this.

250 mail.somedomain.com Hello mail.someotherdomain.com [10.10.10.20]

Now send your "From" command. This is the person the e-mail is from.

MAIL FROM:<Jim@someotherdomain.com>

You should get the following back.

250 OK

Then send your RCPT command. This is the person recieving the e-mail.

RCPT TO:<Joe@somedomain.com>

You should get the following back.

250 OK

Then send your DATA command. This is the body of your e-mail.

DATA

You should get back something from the server that looks like this.

354 Enter message, ending with "." on a line by itself

Now to create the body of the message. Put in the subject line and the message. Then put a period by itself as the last line and hit the "enter" key to finish.

Subject:Test Message
This is a test message.
.

You will get a message back from the server saying your message was accepted (queued).

250 OK: queued as 18C6vd0005Ey-00

Then type your last command to finish your session.

QUIT

You will see the connection end

221 mailhub.somedomain.com closing connection Connection closed by foreign host

Del.icio.us! | Digg Me! | Reddit!

Related stories


RSS Feed RSS feed logo
About


3com
3ware
alsa
alsactl
alsamixer
amd
android
apache
areca
arm
ati
auditd
awk
badblocks
bash
bind
bios
bonnie
cable
carp
cat5
cdrom
cellphone
centos
chart
cifs
cisco
cloudera
comcast
commands
comodo
compiz-fusion
corsair
cpufreq
cpufrequtils
cpuspeed
cron
crontab
crossover
cu
cups
cvs
database
dbus
dd
dd_rescue
ddclient
debian
decimal
dhclient
dhcp
diagnostic
diskexplorer
disks
dns
dos
dovecot
drac
dsniff
dvdauthor
e-mail
echo
editor
emerald
ethernet
expect
ext3
fat32
fedora
fetchmail
fiber
filesystems
firefox
firewall
flac
flexlm
floppy
flowtools
fonts
format
freebsd
ftp
gdm
gnome
greasemonkey
greylisting
growisofs
grub
hacking
hadoop
harddrive
hba
hex
hfsc
html
html5
http
idl
ie
ilo
intel
ios
iperf
ipmi
iptables
ipv6
irix
javascript
kde
kernel
kickstart
kmail
kprinter
krecord
kubuntu
kvm
lame
ldap
linux
logfile
lp
lpq
lpr
maradns
matlab
memory
mencoder
mhdd
mkinitrd
mkisofs
moinmoin
motherboard
mouse
movemail
mplayer
multitail
mutt
myodbc
mysql
mythtv
nagios
nameserver
netflow
nginx
nic
ntfs
ntp
nvidia
odbc
openbsd
openntpd
openoffice
openssh
openssl
opteron
parted
partimage
patch
perl
pf
pfflowd
pfsync
photorec
php
pop3
pop3s
ports
postfix
power
procmail
proftpd
proxy
pulseaudio
putty
pxe
python
qemu
r-studio
raid
recovery
redhat
router
rpc
rsync
samba
schedule
scsi
seagate
seatools
sed
sendmail
sgi
shell
siw
smtp
snort
solaris
soundcard
sox
spam
spamd
sql
sqlite
squid
ssh
ssh.com
ssl
su
subnet
subversion
sudo
sun
supermicro
switches
symbols
syslinux
syslog
systemrescuecd
t1
tcpip
tcpwrappers
telnet
terminal
testdisk
tftp
thttpd
thunderbird
timezone
ting
tools
tr
trac
tuning
tunnel
vi
wget
wiki
windows
windowsxp
wireless
wpa_supplicant
x
xauth
xfree86
xfs
xinearama
xmms
youtube
zdump
zic
zlib