Cannot get Sendmail to work.

Posted on 2005-05-04
Last Modified: 2010-03-05
Hello Everyone,

Please bear with me as I am new to perl. I have been tasked to move a web site form one ISP to another. I am trying to replicate the formmail and send mail routines as I expect out new ISP to supply them.

I have installed Perl onto a Window XP machine running IIS. I have then installed Mail-Sendmail-0.79 from

The Sendmail routine seems to install correctly, and I have changed the configuration as follows :

%mailcfg = (
    # List of SMTP servers:
    'smtp'    => [ qw(,localhost ) ],
    #'smtp'    => [ qw( ) ], # example

    'from'    => '', # default sender e-mail, used when no From header in mail

    'mime'    => 1, # use MIME encoding by default

    'retries' => 1, # number of retries on smtp connect failure
    'delay'   => 1, # delay in seconds between retries

    'tz'      => '', # only to override automatic detection
    'port'    => 25, # change it if you always use a non-standard port
    'debug'   => 0 # prints stuff to STDERR

When I execute the HTML page the seems to work as it displays a page after submission detaining the fields sent. However the email part does not seem to work. I'm not sure if it has even been executed can anyong help please ?

The formmail has been configured with the line :

$mailprog ='C:\Perl\site\lib\Mail\';

This is the location of the sendmail script within the perl directory.

I am also able to see if the mail has been sent as I am running a local email server.

If anyone has a working set of scripts I will also be willing to reinstall different ones, aslong as I have instructions to follow.

Many thanks in advanced.
Question by:chunky1
    LVL 48

    Expert Comment

    You would be best to ask your ISP which SMTP you should be using.   Then you don't have to worry about installing other modules.
    LVL 16

    Expert Comment

    I hope you are checking sendmail()'s return code

    sendmail(%mail) or $err_msg="$Mail::Sendmail::error";
    if($err_msg) {
    #wrap some error message in CGI

    Accepted Solution

    PAQed with no points refunded (of 125)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
    In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now