homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

Can I make my own SMTP server ?
is there a script or something ?

 7:08 am on Mar 14, 2002 (gmt 0)

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




 2:51 pm on Mar 14, 2002 (gmt 0)

What exactly are you trying to do?

You don't need a local server to send mail from your box.


 6:04 pm on Mar 16, 2002 (gmt 0)

Thanks Bird,

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



 7:49 pm on Mar 16, 2002 (gmt 0)

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... ;)


 2:01 am on Mar 17, 2002 (gmt 0)

Thanks Bird,

Apache, Perl 5.6, sendmail and whatever else I need ;)




 3:05 am on Mar 17, 2002 (gmt 0)

If you want to use the system's sendmail executable, then you have to prepare your message like this:

To: "Some one" <someone@example.com>
From: "My Self" <myself@example.com>
Return-Path: "My Self" <myself@example.com>

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.


 2:38 pm on Mar 17, 2002 (gmt 0)

Cheers Bird,

I will be busy for a while I think :)

I'll give it a try, thasnks for the pointers.



 2:54 pm on Mar 17, 2002 (gmt 0)

Oh, and you probably want to add a "Subject: blah blubb" header as well... ;)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved