Sponsored Content
Top Forums UNIX for Dummies Questions & Answers using mailx with multiple recipients Post 302226065 by jim mcnamara on Monday 18th of August 2008 05:17:02 AM
Old 08-18-2008
LINE_MAX bytes - usually something like 2048 is the maximum length of an input line to mailx. This includes the "to" line. Check this for your system.

However, mail servers limit line size, and spam blockers may also stop messages like that. Since mail requests are processed asynchronously some code like this works:

assume that mail.txt is a list of email addresses -
Code:
while read dest
do
  echo "this is a test" |  \
    mailx -s 'trying to have my IP shutdown my account as a spambot'  $dest
done < mail.txt

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multiple File Attachment Using Mailx

HI, I want to send mail using mailx and also want to attach all files under specific directory.(*.*). Please show me a script. Thanks (3 Replies)
Discussion started by: pnathani
3 Replies

2. Shell Programming and Scripting

uuencode mailx - send multiple emails

The following is an extract from one of my Shell Scripts which uses uuencode and mailx to send an email with multiple attachements: uuencode $LOG_REPORT $(basename $LOG_REPORT) uuencode $HTML_FILE $(basename $HTML_FILE ) ) | if then mailx -b "$COPY_TO" -s "$SUBJECT" -r "$MAIL_FROM"... (2 Replies)
Discussion started by: suthera
2 Replies

3. Programming

Python: multiple email recipients

I am using a the following backup script to backup a server to USB. USBBackupScript - RdiffBackupWiki However I don't know python and would like to alter the script so I can send emails about the success or failure of the backup to multiple recipients. I did do some research but the limit... (0 Replies)
Discussion started by: jelloir
0 Replies

4. Shell Programming and Scripting

Not able to send multiple attachments using uuencode and mailx

Hi, I am seeing some junk characters when I attach the second file, given below is the logic I used. Please help me resolving the issue. ( uuencode file1.txt file1.txt.lst && uuencode file2.txt file2.txt.lst ) > attachment.txt cat body.txt attachment.txt > combinemail.txt mailx -m... (7 Replies)
Discussion started by: prasperl
7 Replies

5. Shell Programming and Scripting

mailx script to do multiple emails

I am looking for a script that I can use with mailx to do the following: 1. Grab usernames from a flat file (one at a time) 2. Attach a file to the email and mail out. Thanks. Cubefeed (3 Replies)
Discussion started by: CubeFeed
3 Replies

6. Shell Programming and Scripting

mailx problem with multiple cc

I am writing a script to send an email of the result of the process but i cannot make the cc work correctly. RECIP="abc@example.com def@example.com" CC="ghi@example.com jkl@eaxmple.com" mailx -s "testing" -c $CC $RECIP < inputfile.txt Result: To: abc@example.com; def@example.com;... (4 Replies)
Discussion started by: The One
4 Replies

7. UNIX for Advanced & Expert Users

Multiple recipients with sendmail

Hi, I use the following to send a mail : sendmail -v someone@box.com < /appli/oracle/rap.txt Can I give several mail address for destination ? How ? For exemple : sendmail -v someone@box.com, someone2@box.com, someone3@box.com < /appli/oracle/rap.txt Thank you. (6 Replies)
Discussion started by: big123456
6 Replies

8. Shell Programming and Scripting

Sending Multiple Attachments using MAILX

I have created a shell scripts and wanted to email users multiple attachments using mailx. I noticed that when I do a man on mailx I see and -a option for attachments. When I run a: mailx -s "test attachments" -a include_file -a exclude_file testuser@mydomain.com (Interrupt -- one more to... (1 Reply)
Discussion started by: metallica1973
1 Replies

9. UNIX for Advanced & Expert Users

Sendmail not showing recipients

I've figured out to do a mail merge with /usr/lib/sendmail which is extremely helpful as it is lightning fast compared to an Outlook mail merge which pretty much locks up my machine while it struggles to push out the emails. I figured out how to send html emails, with dynamic variables, and how... (8 Replies)
Discussion started by: MaindotC
8 Replies

10. UNIX for Dummies Questions & Answers

Problem getting mailx to send true Bcc mail to multiple recipients

I am having trouble getting mailx to send multiple Bcc mails out without everyone in the list of recipients seeing everyone else's email addresses. I looked at the man pages of my system and seem to be following the syntax correctly, but the mails still go out as if I were just putting in a list of... (7 Replies)
Discussion started by: legrandtimonier
7 Replies
MHMAIL(1)							     [nmh-1.5]								 MHMAIL(1)

NAME
mhmail - send or read mail SYNOPSIS
mhmail [addrs ...] [-body text] [-cc addrs ...] [-from addr] [-subject subject] [-version] [-help] DESCRIPTION
mhmail is intended as a replacement for the standard Berkeley mail program (mail or mailx), which is compatible with nmh. This program is intended for the use of programs such as cron, which expect to send mail automatically to various users. It is also used by various nmh commands to mail various error notifications. Although mhmail can be used interactively, it is recommended that comp and send be used instead to send messages. When invoked without arguments, it simply invokes inc to incorporate new messages from the user's maildrop. When one or more users is specified, a message is read from the standard input and spooled to a temporary file. mhmail then invokes post with the name of the tempo- rary file as its argument to deliver the message to the specified user. The -subject subject switch can be used to specify the "Subject:" field of the message. By default, mhmail will read the message to be sent from the standard input. You can specify the text of the message at the command line with the -body text switch. If the standard input has zero length, mhmail will not send the message. You can use the switch -body "" to force an empty message. Normally, addresses appearing as arguments are put in the "To:" field. If the -cc switch is used, all addresses following it are placed in the "cc:" field. By using -from addr, you can specify the "From:" header of the draft. Naturally, post will fill-in the "Sender:" header correctly. FILES
/usr/bin/mh/inc Program to incorporate maildrop into folder /usr/lib/mh/post Program to deliver a message /tmp/mhmail* Temporary copy of message SEE ALSO
inc(1), post(8) DEFAULTS
None CONTEXT
If inc is invoked, then inc's context changes occur. MH.6.8 11 June 2012 MHMAIL(1)
All times are GMT -4. The time now is 01:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy