Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Shell Script To Send Email via SMTP username and password

  1. #1
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Lightbulb Shell Script To Send Email via SMTP username and password

    hey..
    i am seeking for a linux script(Shell script)
    that reads from text file "email addresses" and send a "message"
    by smtp server which i set !

    for example..
    lets say that i have in my shell 2 files!
    one file includes the email addresses that i wanna send to
    for example.. the file which is named emails contains :-

    koko @hotmail.com
    veko@hotmail.com
    xxxxxxx@.....com
    ...

    and the second file which has the message for example:.
    the file message contains the letter

    "welcome all to my world"

    now i want to send the letter/message "welcome all to my world" to the email addresses that i mentioned above "koko@hotmail.com veko@hotmail.com ,,etc"

    *note: i could use the pine / mail command ,, but as you know all.. pine and mail sends to junk/or as a spam for hotmail.. so i wanna be sure that my message was delivered to users in their inbox and not in junk
    for that reason i wanna specific/special script mailer that sends via my "gmail" account that i set(configure)
    for example:-

    port:23
    smtp-server:smtp.gmail.com
    user:eawedat
    password:*****
    and to send via my email..

    the script should look like this to run in linux..

    ./mail emails message

    I hope that u understand me.
    thanks.

  2. #2
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,512
    Thanks
    17
    Thanked 799 Times in 511 Posts
    Rep Power
    10

    Default

    This is not hard, you have many choices

    # 1 - Configure local email server to send an email via ISP SMTP server and write normal shell scrip to router all mail using mail command. This is easiest and works with everything.

    # 2 - Use special smtp mail client such as
    Software :: SendEmail - Send email with this free command line email client
    mailsend - send mail via SMTP Protocol
    Google for other software

    # 3 - use perl / php to send email
    php example PHP Send Email Using Authenticated SMTP Mail Server In Real Time

    Perl code
    Sending mail with Perl mail script
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  3. #3
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Smile

    thank you very much nixcraft
    can you please explain to me the first step ? #1 in commands


    best regards,
    eawedat.

  4. #4
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,512
    Thanks
    17
    Thanked 799 Times in 511 Posts
    Rep Power
    10

    Default

    Quote Originally Posted by eawedat View Post
    thank you very much nixcraft
    can you please explain to me the first step ? #1 in commands


    best regards,
    eawedat.
    Use sendmail as smarthost, see
    Configure sendmail as a smart host : nixCraft
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  5. #5
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Default thanks nixcraft

    smart brain nixcraft

  6. #6
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Exclamation made a new sendMail

    here we go

    sendMail.rar

    I hope its legit to post websites
    its same script of sendMail written/coded in VBScript
    the only thing has to do is to mask the password
    that thing i did not find in google.
    Be to be and not to pee

  7. #7
    Senior Member raj's Avatar
    Join Date
    Jun 2005
    Location
    Hyderabad
    Posts
    566
    Thanks
    57
    Thanked 41 Times in 38 Posts
    Rep Power
    14

    Default

    Quote Originally Posted by eawedat View Post
    here we go

    sendMail.rar

    I hope its legit to post websites
    its same script of sendMail written/coded in VBScript
    the only thing has to do is to mask the password
    that thing i did not find in google.
    .exe file for UNIX? Are you out of your mind? Why?
    Raj
    Linux rulz.
    I have never turned back in my life ; I shall not do so today.. haha

  8. #8
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Smile

    raj
    am I out of my Mind?
    do you even know me to ask such a question?
    am I your friend?

    or you have registered to post negative replies?
    am not sure.

    1) I DID NOT SAY THAT IT'S for LINUX

    2) Google -> Wine.

    bye.
    Be to be and not to pee

  9. #9
    Senior Member raj's Avatar
    Join Date
    Jun 2005
    Location
    Hyderabad
    Posts
    566
    Thanks
    57
    Thanked 41 Times in 38 Posts
    Rep Power
    14

    Default

    Take it easy friend. .exe files will not run under Linux and wine is not solution. Most linux user don't like .exe and vbscripts so that is why i said are you out mind for posting .exe file, at least you could warn us it is .exe file without source code? I

    I mean no harm peace and chill out
    Raj
    Linux rulz.
    I have never turned back in my life ; I shall not do so today.. haha

  10. #10
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Smile is there way to use mail list?

    can I send to mail list at once?

    for example -list file.txt
    file.txt has maillist each email seperated by comma.
    I could not find that option.

    thanks.
    Be to be and not to pee

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. shell script to send mail for each login.
    By ephdia in forum Shell scripting
    Replies: 2
    Last Post: 27th November 2007, 04:42 PM
  2. shell scripting + send mail with header
    By ephdia in forum Shell scripting
    Replies: 0
    Last Post: 27th November 2007, 11:29 AM
  3. A script for generating cPanel backup and send as email
    By vivekv in forum Shell scripting
    Replies: 0
    Last Post: 20th October 2007, 08:28 PM
  4. can not find the username in /etc/passwd file
    By subrata1in in forum Getting started tutorials
    Replies: 5
    Last Post: 27th March 2007, 11:45 AM
  5. Shell script to supply or input a password passphrase
    By kasimani in forum Shell scripting
    Replies: 1
    Last Post: 21st February 2007, 09:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •