Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: how to use CLI send maillist?

  1. #1
    Join Date
    Feb 2008
    Location
    guangzhou,guangdong,CHINA
    Posts
    26
    Rep Power
    7

    Default how to use CLI send maillist?

    now I have a maillist ,I want to send them some email.

    How to use CLI to do this job?

  2. #2
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Code:
    echo "this is a test" | mailx -s "Test Email" x@xyz.com

  3. #3
    Join Date
    Feb 2008
    Location
    guangzhou,guangdong,CHINA
    Posts
    26
    Rep Power
    7

    Default

    my mail list is in "maillist.txt"
    my email content is in "email.txt"

    then how ?

  4. #4
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Code:
    while read EMAIL
    do
      cat email.txt | mailx -s "SUBJECT" ${EMAIL}
    done < maillist.txt

  5. #5
    Join Date
    Feb 2008
    Location
    guangzhou,guangdong,CHINA
    Posts
    26
    Rep Power
    7

    Default

    thx for your help!

    now a new problem is:

    send email.html,not email.txt.how to ?

    if use cat email.html,send html source....

  6. #6
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Code:
    while read EMAIL
    do
      cat email.html | mailx -s "SUBJECT" -a "Content-type: text/html; charset=us-ascii" ${EMAIL}
    done < maillist.txt

  7. #7
    Join Date
    Feb 2008
    Location
    guangzhou,guangdong,CHINA
    Posts
    26
    Rep Power
    7

    Default

    mailx: invalid option -- a

    option -a not work?

  8. #8
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    What Linux distro are you running ?

  9. #9
    Join Date
    Feb 2008
    Location
    guangzhou,guangdong,CHINA
    Posts
    26
    Rep Power
    7

    Default

    cent os 4.6

  10. #10
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Code:
    while read EMAIL
    do
      mutt -e 'set content_type="text/html"' ${EMAIL} -s "SUBJECT" < mail.html 
    done < maillist.txt

Similar Threads

  1. send email via cli
    By comptekki in forum Administrators
    Replies: 6
    Last Post: 08-06-2008, 08:22 AM
  2. Replies: 5
    Last Post: 06-18-2008, 02:50 AM
  3. yahoo cant send email to zimbra account.. Why ???
    By bageur in forum Administrators
    Replies: 7
    Last Post: 05-08-2008, 05:50 AM
  4. Cannot send mail via connector
    By ericwk in forum Zimbra Connector for Outlook
    Replies: 10
    Last Post: 08-16-2007, 10:46 AM
  5. None of your e-mail accounts could send to this recipient.
    By BarrySDCA in forum Zimbra Connector for Outlook
    Replies: 2
    Last Post: 05-25-2006, 06:58 PM

Posting Permissions

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