View Full Version : Help with Sendmail_Emulator
thatsdamore 12-10-2004, 06:01 PM Greetings-
Bit of an amateur here. I purchased a template and am trying to setup the contact page on my website. This page uses a sendmail script, but unfortunately my host server is Windows and cannot accept this type. I was told to use a sendmail emulator which I have done; however, I can't seem to get it to work and I've been trouble-shooting this for hours.
Can you give me some guidance??
Thanks, Michael
Well, first of all, how are you calling the sendmail emulator from your script (what are you putting in as your path to sendmail).
Second, did you define the $smtp_server variable?
thatsdamore 12-10-2004, 06:58 PM <form method=POST action="http://thompsonreporters.com/cgi-bin/sendmail_emulator.cgi" target="_top">
<INPUT TYPE="HIDDEN" NAME="recipient" VALUE="info@thompsonreporters.com">
<INPUT TYPE="HIDDEN" NAME="subject" VALUE="WebSite Contact">
<INPUT TYPE="HIDDEN" NAME="redirect" VALUE="http://thompsonreporters.com/thanks.htm">
<INPUT TYPE="HIDDEN" NAME="required" VALUE="email,your_name">
<input type=hidden name="sort" value="through,your_name,phone,company_name,email,comment s">
Yes I defined SMPT as
$smtp_server = "drew.sd.stargateinc.net";
That will not work. You need whatever script is handling your contact information, to use the emulator as sendmail.
In otherwords, many scripts use sendmail to send email. Some systems do not offer sendmail, so instead of pointing your script to use sendmail, you point it to use the emulator.
I think what you are looking for is the World Wide Contact. You can use that, in conjunction with the emulator on a system with no sendmail support.
thatsdamore 12-10-2004, 07:10 PM Thank you very much, I'll give it a try.
thatsdamore 12-10-2004, 07:17 PM I'm not sure that I explained myself clearly.
The "contact" page that I am referring to is a typical form that someone uses to gather some info then submit. It is not a contact via email for.
It has let's say 4 fields to input data, ie, name, email, request, then a submit button.
Does this make sense? Sorry, I'm still in the learning stages.
What is the World Wide Contact. Where do I find that?
Thanks again!
You should really read up on what it is you are trying to do. From what I can make out of what you are saying, you need the user to submit the form and then somehow get those details to you correct? Well I suppose you want those form details sent to you by email, if not, then we cannot help you.
If your host allows you to run CGI scripts, then you can use our World Wide Contact to take data from your form, email it to you etc.
Now if your host does not have software installed called "Sendmail", then you will have to ALSO use our sendmail_emulator to EMULATE the software called "Sendmail".
I really do not know how to make it any clearer.
thatsdamore 12-17-2004, 10:21 AM That is what I've been trying to do; I just can't get the Sendmail emulator to work. I have a feeling that I am doing something wrong. I have tried many different combinations and have spend probably 20 hours on this (obviously, because I am an amateur).
When I bring up this page, it appears as follows:
Sample Contact Form
If you have any questions regarding our products or services, please contact us by calling or e-mailing us and we'll get back to you as soon as possible. We look forward to hearing from you.
#!/usr/bin/perl use Net::SMTP; #### Sendmail Emulator V1.0 By World Wide Creations 2004. Released 08/10/2004 #### Feel free to use as you wish but you may not redistribute this code or include #### it in any script without a linkback to worldwidecreations.com. Please contact #### WorldWideCreations.com for more information. #### Instructions: #### #### Define the variable below to the domain name, or IP address of the SMTP server #### you wish to use. #### #### Make sure your server has Net::SMTP installed. If not, install now. #### #### Upload this script to your server in ASCII mode. Make sure this script is not #### open to the web. You should put this in a restricted area of your webserver #### where it cannot be called by a browser. You do not want any user but you to have #### access to this script. #### #### Please note, some windows users may have to rename this script with a .pl extension #### This depends on your server configuration. #### #### Make sure the script has permission to run (CHMOD 755 on *nix). #### #### This script allows you to emulate Sendmail that many Perl/CGI scripts require. #### When a script asks you for the path to Sendmail, just give them the path to this #### script. #### #### For example: /home/mywebsite.com/somedir/sendmail_emulator.cgi #### #### This path MUST be correct or forget it, the script will not work because it will not #### be activated. This is not the URL, but the basepath (directory path). ### Define your SMTP server here. $smtp_server = drew.sd.stargateinc.net; ##### No More Editing Required. if ($ARGV[0] =~ /v/) { print "Will Run In Verbose Mode
"; } my ($mail_data,$to,$from,@target); while () { $mail_data .= $_; } my @email = split(/[\r\n]+[\r\n]/, $mail_data,2); my @header = split(/[\r\n]/,shift(@email)); foreach (@header) { @target = split(/ /, $_,2); if (($target[0] eq "To:") || ($target[0] eq "TO:")) { $to = $target[1]; chomp($to); } if (($target[0] eq "From:") || ($target[0] eq "FROM:")) { $from = $target[1]; chomp($from); } } if (!($to)) { print "Must have a To: field" unless ($ARGV[0] !~ /v/); die("Must have a To: field"); } if (!($from)) { print "Must have a From: field" unless ($ARGV[0] !~ /v/); die("Must have a From: field"); } $smtp= Net::SMTP->new($smtp_server, Debug => 0,); $smtp->mail($from); $smtp->to($to); $smtp->data(); $smtp->datasend($mail_data); $smtp->dataend(); $smtp->quit;
Thompson Court Reporters, Inc.
1 South Wacker Drive, Suite 1616
Chicago, IL 60606
PHONE: 312-346-DEPS(3377)
E-mail us: info@thompsonreporters.com
The Send Emulator script appears as plain text. I have a feeling that there is something basic that I am not doing. I have tried to load the form in both my root directory and a cgi-bin folder, though I get the same results.
Any suggestions for me?
I think you need to get a basic understanding on how CGI scripts work before you attempt to install any.
thatsdamore 12-17-2004, 04:23 PM Just trying to do what I can. I purchased a template online and have customized and installed every page. Unfortunately this one page is giving me trouble. I do not write code, understand html, or plan to. Just trying to start up a small business.
Can you give me any guidance?
LOL, I am really not trying to be a wiseguy here, but do you mean to tell me that you want to start an online business without learning HTML. To me, this is like saying "I want to be a truck driver but I don't want to learn how to drive".
Basically, in order to do what you want, you are going to HAVE to learn basic HTML and at least a working knowledge on how to install PHP or Perl(CGI) scripts. There really is not a way around it other than hiring a webmaster to take care of it for you.
thatsdamore 12-17-2004, 05:08 PM LOL, I do appreciate all of your replies Jafo.
I have started a court reporting business. The website is just to support such endeavor. My site is up, running, and has received a ton of positive feedback. I purchased a template online and, though challenging, it was a great decision for me.
There is one single page that I can't get to work, and that is a forms-type page. There are certain clients that will want to request some info, and I'd in turn would like them to enter some info. This is the final step!
If you care to take a look, my site www.thompsonreporters.com
Again, I'm just trying to get my last page up and running.
Forms do not just work on their own, the form needs to POST the information to software, which in turn processes that data and takes whatever action you want on it.
It is something that runs server side.
What scripts do is accept the info and process it. Our WW Contact will take all form data and send it to wherever you wish. The code is not entered into the webpage, it runs on it's own separately, on your webserver, assuming it has that capability.
The script must be INSTALLED on the server like any other CGI script. I don't know how to help you though, if you are unwilling to learn how to install scripts. :)
|
|