Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

sendmail error

by l.frankline (Hermit)
on Sep 29, 2006 at 09:57 UTC ( #575492=perlquestion: print w/replies, xml ) Need Help??

l.frankline has asked for the wisdom of the Perl Monks concerning the following question:

Dear all,

I am trying to send mail to an email id, while doing so, I got an error as :
'sendmail' is not recognized as an internal or external command, operable program or batch file.

Please let me know your suggestion what is the problem exactly. Please give me your valuable suggestions.

use MIME::Lite;

  $msg = MIME::Lite->new(
                 From    =>'',
                 To      =>'',
                 Subject =>'HTML with in-line images!',
                 Type    =>'multipart/related'
    $msg->attach(Type => 'text/html',
                 Data => qq{ <body>
                             Here's <i>my</i> image:
                             <img src="C:\temp\tendul1.jpg">
                             </body> }

Thank You,

Don't put off till tomorrow, what you can do today.

Replies are listed 'Best First'.
Re: sendmail error
by marto (Cardinal) on Sep 29, 2006 at 10:11 UTC

    A couple of things, Firstly are you using sendmail to send email? Take a look at the MIME::Lite documentation regards the default settings and configuration:

    "On Unix systems (at least), the default setting is equivalent to:
    MIME::Lite->send("sendmail", "/usr/lib/sendmail -t -oi -oem");"

    Also the html content of your message assumes the recipient has a file called C:\temp\tendul1.jpg.

      Also the html content of your message assumes the recipient has a file called C:\temp\tendul1.jpg

      It's worse than that. It assumes that the recipient has a file called C:{tab}emp{tab}endul1.jpg - which seems very unlikely :-)


      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg

        Jesus Jones! I didn't spot that one :) That is what I get for replying to nodes when I'm busy at work :)
Re: sendmail error
by davorg (Chancellor) on Sep 29, 2006 at 10:16 UTC

    MIME::Lite by default uses sendmail to, er... send the mail. This is described in the section Change How Messages are Sent in the documentation.

    Looks like you're trying to use it on a system that either doesn't have sendmail or has sendmail in a non-standard location. You'll need to change the configuration of the module appropriately - see also the section Sending.

    Update: Taking another look at your error message, I'm pretty sure that's a Windows message (you should really include important facts like that in you question). Windows doesn't have a sendmail program (well, not by default, you can get sendmail-a-like programs for it) so your best bet is to find the name of your network's SMTP server and use that approach.


    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: sendmail error
by gellyfish (Monsignor) on Sep 29, 2006 at 10:24 UTC

    Windows doesn't have a sendmail. See the section entitled "Change how messages are sent" in the MIME::Lite documentation. You will need to find out the address of an appropriate SMTP server.


Re: sendmail error
by Khen1950fx (Canon) on Sep 29, 2006 at 10:49 UTC
    It may be that, if you're at work, someone set up MIME::Lite to use the optional module that comes with MIME::Lite called It's a subclass of MIME::Lite which doesn't provide any new methods, instead it supposedly "enhances" MIME::Lite's existing ones. Basically, it changes the default send method from sendmail to smtp. Check out the docs that davorg mentioned to see how to do send_by_smtp.

    Update: I'm sorry. I didn't catch the Windows backslashes. It's been a long day...

Re: sendmail error
by kwaping (Priest) on Sep 29, 2006 at 15:28 UTC
    Try using Mail::Sendmail instead, which is platform-independent. My company uses it in production and has had no problems.

    It's all fine and dandy until someone has to look at the code.
      So how do you attach files with Mail::Sendmail, as the OP needs? MIME::Lite allows you to specify the SMTP server just as Mail::Sendmail does, so it is no less platform independent.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://575492]
Approved by marto
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2023-03-30 05:14 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (73 votes). Check out past polls.