command line sendmail
I need help with commandline sendmail.
I want to send an email with an attachment . I would like to be able to use the Cc: and Bcc: Subject: Body: plus have an attachement sent with the email. !cat /tmp/testpage.txt | /usr/sbin/sendmail -i -oi -f "from@from.com" "sendto@sendto.com" this places the file into the body, but the format gets messed up how can I send an attachment. I dont care if I need to use a perl script just so long as I can pass it the from: email To: email and the body then the attachment and a subject line would be nice. Can anyone help. |
If testpage is plain text and you don't need to interface with sendmail as a requirement you could just: "cat /tmp/testpage.txt | mail -s <subject> -c <cc addr> -b <bcc addr> <to addr>".
|
if you really want an attachment you need to get a MUA (Mail User Agent) or a small program (perl with MIME::Lite, etc) to do the job.
sendmail is a MTA (Mail Transfer Agent) and doesn't care for mail content (MIME attachments, etc), but only for delivery. Code:
## from: http://www.experts-exchange.com/Prog..._20208667.html |
unspawn This is great but it is not quit completely what i need.
I just tried this way and it gives me the subject and the addressing with cc bcc, but it still placed the file into the body of the email and not as an attachment. I would also like to change the from user so it is not just from who is logged in. |
you can use metasend and metamail to do what you are looking to do. I havnt tried either yet, but I know they support scripted mail with attachments.
|
All times are GMT -5. The time now is 06:53 PM. |