|Can I make my own SMTP server ?|
is there a script or something ?
I just want to be able to send emails with my own SMTP server.
Is there a script ?
What about the sendmail perl module ?
Any ideas ???? :)
Thanks in advance
What exactly are you trying to do?
You don't need a local server to send mail from your box.
I am doing another hobby site :) and I want to send emails without using the Yahoo SMTP because of the footer.
I just want to be able to send emails without any footer, or a footer I can control.
Thanks for your help
On a unix system, you'd typically just feed your mail to /usr/sbin/sendmail. This is somewhat confusing, as otherwise sendmail is known as SMTP server, but doesn't act in this role when called directly. Sendmail is a beast with many heads, only one of which includes the SMTP server functionality. I suspect that this is what the sendmail perl module does that you mention. If available on your host, that would probably be the most elegant solution.
If you're hosted on a Windows box, things will look different. I'm not familiar with any standard mail injection mechanisms there, if those even exist. If you don't find anything, using a SMTP server might indeed be an option. But then, that doesn't necessarily have to be one you run yourself, not even one run by your hosting provider.
In other words, your problem will be easier to solve when you tell us a little more about the infrastructure you have at your disposal... ;)
Apache, Perl 5.6, sendmail and whatever else I need ;)
If you want to use the system's sendmail executable, then you have to prepare your message like this: To: "Some one" <firstname.lastname@example.org>
From: "My Self" <email@example.com>
Return-Path: "My Self" <firstname.lastname@example.org>
this is the message
text that may or may not go
over several lines
Then invoke "/usr/sbin/sendmail -t", probably with whatever implementation of popen you have available in Perl, and feed it the above message on stdin. The first empty line in the data stream seperates the headers from the message text (you could add other headers like CC: or BCC: if you need to). The "-t" option to sendmail tells it to take the recipients and sender addresses from the headers in the data. In pseudocode (or Python), a working procedure would look like this:
def send_with_sendmail(recipient, sender, msg):
f = os.popen("/usr/sbin/sendmail -t", "w")
f.write("To: " + recipient + "\n")
f.write("From: " + sender + "\n")
f.write("Return-Path: " + sender + "\n")
Translate to gibberish (or Perl ;)) at your own risk.
I will be busy for a while I think :)
I'll give it a try, thasnks for the pointers.
Oh, and you probably want to add a "Subject: blah blubb" header as well... ;)