Sending mail from a CGI

Sending mail from a CGI

Posted by: JesseC
Posted on: 2007-10-22 14:39:00

Im trying to send an email out in a perl cgi, the code seems to work fine on my local system, but on dreamhost it does not work.
Im trying to use sendmail(/usr/sbin/sendmail) but it does not seem to be working. I have tried directly calling sendmail from the command line and sending myself an email(on another dreamhost account), but the email never appears. I sendmail not usable? Should i send mail out using SMTP instead?

Edited by JesseC on 10/22/07 05:45 PM (server time).

Re: Sending mail from a CGI

Posted by: rlparker
Posted on: 2007-10-22 16:07:00

In reply to:

Im trying to use sendmail(/usr/bin/sendmail) but it does not seem to be working.


On Dreamhost, the path to sendmail is /usr/sbin/sendmail.

--rlparker

Re: Sending mail from a CGI

Posted by: JesseC
Posted on: 2007-10-22 17:46:00

Woops, that was a mistake in my original post. I was using /usr/sbin/sendmail



Re: Sending mail from a CGI

Posted by: JesseC
Posted on: 2007-10-23 11:22:00

Ok, I figured it out, the message that my script was passing to sendmail started with a newline, once that was removed it works.

Re: Sending mail from a CGI

Posted by: rlparker
Posted on: 2007-10-23 13:48:00

Ah! Yep, that would do it! Thanks for taking the time to post back and share what the problem turned out to be. That's useful to others faced with a similar problem! smile

I'm glad you got it working!

--rlparker

Tags: sending mailsend an emailsendmaildreamhostperl cgiserver timelocal systemsmtpusr