![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| email addresses | okbrowder | UNIX and Linux Applications | 0 | 04-20-2008 12:02 PM |
| keeps telling me my email addresses don't match | r0k3t | Forum Support Area for Unregistered Users & Account Problems | 0 | 01-22-2007 06:13 AM |
| How to delete old email addresses? | Deede | UNIX for Dummies Questions & Answers | 1 | 02-03-2004 12:25 PM |
| How to delete email addresses | Deede | High Level Programming | 4 | 02-02-2004 03:23 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Email Question - two email addresses
Hello,
I have an email script that runs when a process is complete. I would like to have the email sent to two different email addresses, but it is only sending it to the first one. Can you take a look and see what I need to correct? I thought if I surrounded them with double quotes and separated them with a comma that would work. I don't have sendmail configured so I use telnet. This is an AIX 5.2 system Thank you. Code:
#!/usr/bin/ksh MAILADDRTO="first@someplace.com,second@someplace.com" MAILADDRFR=email@mail.com (sleep 5 echo EHLO sleep 5 echo MAIL FROM: $MAILADDRFR sleep 5 echo RCPT TO: $MAILADDRTO sleep 5 echo DATA sleep 5 echo From: $MAILADDRFR echo To: $MAILADDRTO echo subject: PBS Check File Created echo echo The PBS check file is available for download echo sleep 5 echo . sleep 5 echo QUIT sleep 5) | telnet 00.00.00.00 25 |
| Forum Sponsor | ||
|
|
|
||||
|
According to google you need to use multiple RCPT lines:
Code:
... for rcpt in `echo $MAILADDRTO | sed 's/,/ /g'` do echo RCPT TO: $rcpt sleep 5 done ... |
|
|||
|
It would work like that if you were using regular Sendmail, but this script attempts to speak raw SMTP, which at least per the spec does require a separate RCPT TO: for each recipient address.
|
|||
| Google The UNIX and Linux Forums |