Lets Try..
First , Install all necessary packages (you must be a root):
apt-get install postfix libsasl2-2 ca-certificates libsasl2-modulespostfix wizard will ask you some question. Just select choice is Internet Site and for email using mail.kisahpemimpi.com (example).
Then, open yout postfix congig file at "main.cf":
nano /etc/postfix/main.cf
and setting at this lines to it:
relayhost = [smtp.gmail.com]:587 #this config just editAnd than create file sasl_passwd:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
nano /etc/postfix/sasl_passwdand add your email and smtp email line:
[smtp.gmail.com]:587 kisahpemimpi@gmail.com:passwordemailAdd permision to just root
chmod 400 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwdNext, validate certificates to avoid running into error. following this command :
cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pemRestart Postfix
/etc/init.d/postfix restartNow, we must installed mailutils or other mailsend client.
Example : apt-get install mailutilsfor using thats use
echo "Haloooooo.. just tested body of email \n\n br orang ganteng" | mail -s "test email" you@gmail.comsome other usefull command is
-s Subjects of the email
-c email address for cc
-b email address for bcc
You can attach using mutt
apt-get install muttand
echo "This is the message" | mutt -s "aaaoooo" kisahpemimpi@gmail.com -a /tmp/image/image.jpgOk, thanks for reading my blog.. sorry my english so bad.. i just learn
Sumber :
http://www.simplehelp.net/2008/12/01/how-to-send-email-from-the-linux-command-line/#Yd1DpSc4xtP4J5Sv.99
https://www.blogger.com/blogger.g?blogID=565872160529894442#editor/target=post;postID=8560783648977948448
1 komentar:
Bole tolong kasih contohnya kak ?hehe
Posting Komentar