![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rsh permission denied | lweegp | Shell Programming and Scripting | 7 | 09-15-2006 04:36 AM |
| Permission Denied | howeezy | UNIX for Dummies Questions & Answers | 0 | 09-14-2005 09:52 AM |
| ./ Permission Denied. | trouscaillon | UNIX for Dummies Questions & Answers | 8 | 01-26-2005 09:33 PM |
| rcp 'permission denied' | Kevin Pryke | UNIX for Dummies Questions & Answers | 6 | 04-24-2002 04:20 AM |
| rsh and permission denied | Reza Nazarian | UNIX for Dummies Questions & Answers | 1 | 10-15-2001 12:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Perl: Sendmail - Permission denied
Hi,
I'm trying to write a simple mail handler perl script for a website I'm working on. I've managed to installed sendmail yesterday, and I'm currently trying to get the script to work. I'm getting an error however. Here's the block of perl code I'm using: Code:
open(MAIL, "| $sendmailpath -t") || print "Error Opening mail: $!"; print MAIL "To: my\@e-mail.com"; print MAIL "Reply: $sender_mail"; print MAIL "Subject: $sender_subj"; print MAIL "\n"; print MAIL "$sender_msg"; close MAIL || print "Error Closing mail: $!"; I'm assuming it's a user/group/permission problem, since the sendmail program is being run by the webscript. However, this is my first time working with sendmail, and I have no idea what the correct settings should be. |
|
|||||
|
Hi,
Chance is you might already have this package Net::SMTP - perldoc.perl.org try it, its the same as yours but avoid invoking sendmail binary directly IMHO. Anyway you can download it on Net::SMTP - Simple Mail Transfer Protocol Client - search.cpan.org |
|
|||||
|
Nope, you're not required to use authentication to send mail only retreiving would ... and you even wont need you're ISP mail gateway.
Here's a sample code: Code:
#!/usr/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new("recipent.server.com",Hello => 'yourdomain.com');
$smtp->mail("fromyou@yourdomain.com");
$smtp->to("user1@server.com");
$smtp->cc("foo@server.com");
$smtp->data;
$smtp->datasend("From: fromyou\@yourdomain.com");
$smtp->datasend("To: user1\@server.com");
$smtp->datasend("Subject: This is a test");
$smtp->datasend("\n");
$smtp->datasend("Body Of The Mail");
$smtp->dataend;
$smtp->quit;
|
![]() |
| Bookmarks |
| Tags |
| sendmail |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|