Operating Systems > Linux and UNIX
command line mail sender !
foobar:
I got pine working now (http://forum.fuckmicrosoft.com/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=5&t=000493), but it's still not what i was looking for.
I need a textmode program to collect email from POP servers, and send email to non-local users via SMTP.
Also i'm looking for a prog that will do the same stuff, but just for sending mail, and that is able to call via the command line:
Something wich you can use this way:
--- Code: ---
--- End code ---
[ July 12, 2002: Message edited by: -=f00bar=- ]
Master of Reality:
i got a question about sending mail from the command line. I want to know what exactly can sendmail do? I want to know if there is a way I can send mail to all the Bobs. Basically tell it the e-mail addresses (a lot of them) and then tell it to send this message or perhaps an html document. And it would be nice to be able to store the addresses in a plain text .dat file.
[ July 12, 2002: Message edited by: Master of Reality / Bob ]
voidmain:
It is very easy, the most basic being:
echo "Hello Bob!" | mail -s "Bob Subject" [email protected]
But what you want to do can easily be done using either a Perl or Shell script. Do a search on google. There are thousands of examples.
Master of Reality:
can i put down more than 1 e-mail at the end?
voidmain:
Well you can, but I would write a Perl script to do it so you can change the "From:", "Reply-To:", etc (properly format the headers the way you want).
It might look something like this one I wrote for another project, not mass mailing mind you:
--- Code: ---
--- End code ---
The above code sample had a lot more code that searched a PostgreSQL database and sent mail to specific people but I hacked it down to just the basics that you are interested in. The above example will actually email HTML content in the body of the message although you can do plain text as well, just remove the "mailhtml" and change the "mailbody" variable to contain only text. Additionally you could read the contents of a file in to the "mailbody" variable or there are a thousand different ways you could do it depending on your needs. You can put more than one email address in any of the "To:", "Cc:" etc blocks, just separate them with commas. You could have your email addresses in a file or database and change the script to read them in and send the message to those in your list. Be creative.
[ July 12, 2002: Message edited by: VoidMain ]
Navigation
[0] Message Index
[#] Next page
Go to full version