I want to send email from HP unix using mailx command. I have to include cc and bcc in my email and have to use the specific email address as the sender.
But -r (which is to define the sender's email address) will disalbe ~ commands so if i have to define the sender's email address, i cannot use ~c and ~b commands for cc and bcc.
Is there any work around???? cos these are the requirements from the user.
Thanks.
After the content is written, press Ctrl+D & EOT will be displayed by mailx. We can send a carbon copy (CC) or a blind carbon copy (BCC) to send the same email to multiple recipients (visibly or in a hidden manner).
mailx puts the completed message into a file called the recipient's system mailbox. The message stays in the system mailbox until the recipient asks to read the message. At that point, the message is obtained from the system mailbox and displayed on the recipient's workstation.
Sending a simple mailRun the command below, to send an email to [email protected]. The s option specifies the subject of the mail followed by the recipient email address. The shell asks for the 'Cc' (Carbon copy) field. Enter the CC address and press enter or press enter without anything to skip.
In my case I have to keep multiple id
's in cc which has been done by giving the email-id
's comma separated one by one as below:
$ echo -e "Hi Team, \n \n Action Needed \n \n Regards, \n XYZ team"| mailx -s "subject" -b [email protected],[email protected] -c [email protected],[email protected] -r [email protected] [email protected]
Also made use of the echo
command to pass multiple lines to mailx
utility. Thought it will be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With