Quote:
Originally Posted by shivaa
If you purpose is just to send an email, you could have tried other mail agents like mailx (see here), mail or sendmail etc.
Code:
~$ mailx -s "<subject" "larrythelegend@yahoo.co.uk" < error.txt
|
Sorry - using ubuntu 12 - bash script from terminal - no email (or any other apps installed).
Yes essentially I want to write a script which installs sendEmail application and sends an email (tried mutt but kept getting all kinds of "unable to attach" errors) so came across:
http://ubuntuforums.org/showthread.php?t=1268015
and sendEmail, installed all packages and was finally able to send an email, but when i put this sendEmail code in script it returned an authenticate error message, just wondering why is it a scope issue?
Code:
#!/bin/bash
#### INSTALL ALL SENDEMAIL PACKAGES ETC...###############
sudo apt-get install logwatch
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.55.tar.gz
tar zxvf sendEmail-v1.55.tar.gz
sudo cp sendEmail-v1.55/sendEmail /usr/local/bin
sudo chmod +x /usr/local/bin/sendEmail
sudo apt-get install libio-socket-ssl-perl libnet-ssleay-perl perl
#### Emter user info ###########
emailsend=XXXXX@gmail.com
emailrec=XXXXXX@yahoo.co.uk
password=XXXXXXX
name=XXXXX
###### Send Email ###############
sendEmail -v -f "$emailsend" -s smtp.gmail.com -xu "$name" -xp "$password" -t "$emailrec" -o tls=yes -u -m Oh Yeah Fuck it -a error.txt
Error:
Feb 20 03:23:57 ubuntu sendEmail[13646]: INFO => Sending: AUTH PLAIN Um9zcwBSb3NzAEJhdGlzdHV0YTY2Ng==
Feb 20 03:23:57 ubuntu sendEmail[13646]: ERROR => Received: 535-5.7.1 Username and Password not accepted. Learn more at, 535 5.7.1
http://support.google.com/mail/bin/a...y?answer=14257 bg5sm33221910wib.8
Checked all above in google help.html above, no joy
sendEmail -v -f "$emailsend" -s smtp.gmail.com -xu "$name" -xp "$password" -t "$emailrec" -o tls=yes -u TEST HEADER -m "logfor/$day" -a ~/error.txt
********************************************************************************
Email script alone will not work...have a go anyone?
Code:
#!/bin/bash
touch error.txt
day=$(date +"%T-%m-%d-%Y")
echo "Enter your email address"
read emailsend
echo "Enter your email password"
read password
echo "Enter recipient email address"
read emailrec
echo "Enter your first name"
read name
clear
echo "Sender is $emailsend"
echo "Password is $password"
echo "Recipient is $emailrec"
echo "Username is $name"
echo "logfor/$day"
sleep 8s
clear
sendEmail -v -f "$emailsend" -s smtp.gmail.com -xu "$name" -xp "$password" -t "$emailrec" -o tls=yes -u TESTHEADER -m "logfor/$day" -a ~/error.txt