PDA

View Full Version : script uses SMTP_Server - server uses sendmail


mgb78owner
11-06-2002, 02:02 AM
I have a cgi script that is written for:

# Your mail server
# Eg. localhost
# $SMTP_SERVER = "!SMTP!";

but my host's server is set up for "sendmail"

Sendmail Path: /usr/bin/sendmail


:confused: How can I change the script so that the content that is sent will point to the "sendmail" rather than the "$SMTP_SERVER". The website I bought the script from does not respond to email requests for help. Now I'm stuck with a script that I can't use because it can't find "sendmail".

I can email the script directly to any senior members that want to have a look at it, I don't think I can legally post it to the forum as it was purchased commercially.

fivesidecube
11-06-2002, 01:27 PM
mgb78owner,

Does the machine already have a copy of sendmail running? Sendmail is normally launched by the machine's boot sequence, generally users don't need to execute sendmail directly. If it does have a copy already running set the value of $SMTP_SERVER to localhost and all should be well.

fivesidecube
11-06-2002, 01:32 PM
mgb78owner,

I've just read your original post. You should check that sendmail is running on your machine via 'ps -x'. If the script works for remote copies of sendmail, then you can access your local instance of the program via localhost as though it was a remote machine.

mgb78owner
11-06-2002, 04:47 PM
Hello,

Please forgive a newbie but I don't understand the 'ps-x' in your post. I use a program called check.pl to see my server's settings and since it lists sendmail paths I assume it has sendmail installed. I don't know how to check if it is running via 'ps-x', is this something the tech support of the hosting company can tell me?

If I understand your post correctly, you indicated I should change the script as follows, is this correct?


# Your mail server
# Eg. localhost
# $SMTP_SERVER = "localhost";

mgb78owner
11-06-2002, 04:56 PM
Hello again,

I tried making the change to:

# Your mail server
# Eg. localhost
$SMTP_SERVER = "localhost";


and now the scipt advises me there was an error trying to email the letter. I then tried the following and received the same error message:


# Your mail server
# Eg. localhost
$SMTP_SERVER = "/usr/bin/sendmail";


Any other suggestions?

mgb78owner
11-06-2002, 05:05 PM
Also tried the following with no results:

# Your mail server
# Eg. localhost
$SMTP_SERVER = "/usr/bin/sendmail/";


and

# Your mail server
# Eg. localhost
$SMTP_SERVER = "Sendmail";




:confused: :confused:

fivesidecube
11-06-2002, 09:23 PM
OK,

The 'ps -x' command is a Unix command that should be entered into a command window. I got the impression that you had login rights on to the server machine. Sorry for confussing you.

OK. Can you please send me a copy of the script via priavte messaging and I'll have look to see if I can identify what you need to do.

Like I have previously said, I don't think that you should be running sendmail directly. Generally, sendmail is started when the machine boots and interactions normally occur via its LAN service.

mgb78owner
11-07-2002, 12:10 AM
Hello,

With the help of my hosting company's tech support we were able to solve the problem. By simply adding the "-t" to the sendmail we were able to get the script functioning. You can compare the other post to this one.

# Your mail server
# Eg. localhost
#$SMTP_SERVER = "localhost";
$SEND_MAIL = "/usr/bin/sendmail -t";

:thumbsup: