Sendmail Tutorial

 
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
cldickerson
-


Joined: 08 May 2004
Posts: 23

PostPosted: Fri Jul 30, 2004 8:33 pm    Post subject: Sendmail Tutorial Reply with quote

I've seen quite a few posts on this forum from webmasters looking for a free alternative to 'sendmail'. There is such a script available that's fairly easy to configure. It is called 'Mailto'. It was written for use on Xitami servers but will work fine on Abyss. Download the script at http://imatix.com/pub/tools/mailto.zip

The only two files that you will need are 'mailto.exe' and 'mailto.cfg'. Both should be placed in your cgi-bin subdirectory. The 'mailto.cfg' can contain a number of directives which I will try to cover later, but a bare-bones configuration follows:
Quote:
[MAILTO]
CGIAPP=Yes
;
[SENDMAIL]
;
; Address of your ISP/mail server
SMTPSERVER=mail.bellsouth.net

The [MAILTO] entry tells the .exe program to run as if it were a .cgi program. The [SENDMAIL] entry is the 'section' of the 'mailto.cfg' file to which your form will refer. The 'section' must be identified because it is possible to setup multiple configurations.

I will provide a sample HTML 'form' at the end of this text but let's first examine your 'form' more closely.

Your HTML 'form' page would call the script as follows:

<FORM METHOD="POST" ACTION="../cgi-bin/mailto.exe">

And, your form must contain (at least):

<input type="hidden" name="SECTION" value="SENDMAIL">
This hidden field tells the 'mailto.exe' script which section in the 'mailto.cfg' file to use.

<input type="hidden" name="TOIDS" value="your@email addr.com">
This field can be used to tell the 'mailto.exe' script where to send the contents of your 'form'.

Other directives that may be placed in your form include:
SENDER ID - Email address of the sender.
CCIDS - Carbon copy email addresses.
BCCIDS - Blind carbon copy email addresses.
SUBJECT - Sets 'Subject' of the email.
MESSAGE - Contains the body of the message.
Any other fields in your 'form' will be included in the email, following the MESSAGE field. Such additional fields will indicate the field name, the field length, and the contents of the field.

Now, let's take a closer look at the 'mailto.cfg' file.

In addition to all of the fields described above, your 'mailto.cfg' file can contain:

FORM - This entry will identify the page on which your form is located. Example: FORM=mypage.htm
OKREPLY - This entry will identify the page to which the user will be redirected after a successful send.
FAILREPLY - This entry will identify the page to which the user will be redirected should the send fail.

And finally, as mentioned earlier, the 'mailto.cfg' file can contain multiple configurations for different 'forms' on your website. Each configuration is identified with a new SECTION name (you may choose to change the section name SENDMAIL to SENDMAIL-2 for example). You would then change the hidden SECTION field in your 'form' to point to the appropriate section in your 'mailto.cfg' file.

It may all sound complicated -- but it's not. Below you will find a 'mailto.cfg' file and a 'form' that you can use immediately on your website:

mailto.cfg --
Quote:
[MAILTO]
CGIAPP=Yes
;
[SENDMAIL]
;
; Name of mail server (Example: mail.yourdomain.com)
SMTPSERVER=mail.bellsouth.net
;
; Reply if successful
OKREPLY=<HTML><meta http-equiv="REFRESH" content="0;url=http://yourdomain.com/thanks.htm"></HTML>
;
; Reply if failure
FAILREPLY=<HTML><meta http-equiv="REFRESH" content="0;url=http://yourdomain.com/senderr.htm"></HTML>

You now need to create three HTML pages. One named 'thanks.htm' which can simply be a 'Thank You for your submission' page. One named 'senderr.htm' which should state that the form could not be sent (usually because of an incorrect email addres). And, your submission page (the page containing your 'form')...

'form' page --
Quote:
<FORM METHOD="POST" ACTION="../cgi-bin/mailto.exe">
<input type="hidden" name="SECTION" value="SENDMAIL">
<input type="hidden" name="TOIDS" value="you@youremail.com">
<input type="hidden" name="Subject" value="Subject of the email">
Your email address: <input type="text" name="SENDERID" size="20"><br>
Your message: <TEXTAREA name=message rows=5 cols=54></TEXTAREA><br>
<INPUT type=submit value=Submit name=B1>

Read the text file that comes with the script. It's not that difficult to figure out, and IT IS FREE!

I hope this little tutorial helps someone. I use the 'mailto' script on my personal website and find it most satisfactory...
Back to top View user's profile Send private message
Axis
-


Joined: 29 Sep 2003
Posts: 336

PostPosted: Fri Jul 30, 2004 10:41 pm    Post subject: Reply with quote

Hi cldickerson--

That was a great contribution. Thanks!

Regards,
Axis
Back to top View user's profile Send private message
MUGH8506
-


Joined: 14 Jun 2004
Posts: 72
Location: Hell

PostPosted: Sun Aug 22, 2004 1:26 pm    Post subject: Reply with quote

Thanks for the tut. But I don't have cgi-bin...
_________________

http://www.trustabyss.com/
Back to top View user's profile Send private message MSN Messenger
rado
-


Joined: 14 Apr 2004
Posts: 67

PostPosted: Mon Aug 23, 2004 10:50 am    Post subject: Reply with quote

If 'mailto.exe' can send emails - probably it can do more than just that!
Running .exe file from a unknown source - is probably a security risk.
And is not so good alternative to PHP 'sendmail'.
(This is personal opinion)

mailto ... !
Back to top View user's profile Send private message
Truplaya3208112
-


Joined: 02 Jul 2004
Posts: 47

PostPosted: Sun Aug 29, 2004 9:50 pm    Post subject: Reply with quote

My server requires authentaction :( and I don't know how to setup a SMTP server cuz I get lost
_________________

We don't have many users. Please help us out and sign up and be active
http://tpcpro.no-ip.com
http://tpcpro.no-ip.com/forum
Back to top View user's profile Send private message
hubson
-


Joined: 10 May 2004
Posts: 94
Location: Coventry

PostPosted: Mon Sep 13, 2004 1:44 pm    Post subject: Reply with quote

I can't seem to get it working
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
GagnierA
-


Joined: 18 May 2004
Posts: 71
Location: Windsor, Ontario, Canada

PostPosted: Fri Dec 31, 2004 1:19 pm    Post subject: Reply with quote

I know this is an old topic, but I just thought I would mention that there is a program out there called Advanced SMTP Server and it can be found at http://www.softstack.com/advsmtp.html ...it's a nice program and runs in your system tray and requires no configuration or anything. This version of it isn't free, but for those of you who know what you're doing know how to fix that little "problem".....if not, they also have a free version of it available.

Hope that helps someone. I use this program and it's great!
Back to top View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group