griffeymania
New Member
Hi,
I have the following issue and am wondering if someone out there may have an idea what is going on. In a nutshell, I have a new VPS on which I have a Perl script that won't run from the browser but *will* run from the command line.
The script uses Mail::Sender, a common mail sending Perl module. I have a simple script set up to send me an email. This script works fine from the command line but times out from the browser. If I comment out the mail sending part of the code it works fine in the browser.
This script was copied directly from my other VPS. It works both on the command line and browser there. Somehow, I think the new VPS has permissions set up differently so that the httpd process owner can't execute the mail sending part of the code. I haven't been able to locate the appropriate error log that may hint at the reason. Here is the code:
>>>BEGIN CODE>>>
#!/usr/bin/perl
use Mail::Sender;
use CGI;
use strict;
my $txt_msg = "This message is in HTML format. Please switch to HTML view in your email program.";
my $html_msg = $txt_msg;
my $sender = new Mail::Sender();
my $from = "orders\@rmspraying.com";
my $to = "brady\@brandnewgraphics.com";
my $subject = "Order Submitted";
if (ref $sender->OpenMultipart({
smtp => 'mail.rmspraying.com',
from => "$from",
to => "$to",
subject => "$subject",
auth => 'LOGIN',
authid => '[my username here]',
authpwd => '[my password here]',
multipart => 'related'})) {
$sender->Part({ctype => 'multipart/alternative'});
$sender->Part({ctype => 'text/plain', disposition => 'NONE', msg => $txt_msg});
$sender->Part({ctype => 'text/html', disposition => 'NONE', msg => $html_msg});
$sender->EndPart("multipart/alternative");
$sender->Close() or die "Close failed! $Mail::Sender::Error\n";
} else {
die "Cannot send mail: $Mail::Sender::Error\n";
}
my $q = new CGI;
print $q->header('text/html');
print "Hello, World!\n";
>>>END CODE>>>
The mail server that it is connecting to is located on my other VPS. I don't think that part is the issue since I can run this from the command line. Any ideas would be greatly appreciated!
Thanks,
Brady
I have the following issue and am wondering if someone out there may have an idea what is going on. In a nutshell, I have a new VPS on which I have a Perl script that won't run from the browser but *will* run from the command line.
The script uses Mail::Sender, a common mail sending Perl module. I have a simple script set up to send me an email. This script works fine from the command line but times out from the browser. If I comment out the mail sending part of the code it works fine in the browser.
This script was copied directly from my other VPS. It works both on the command line and browser there. Somehow, I think the new VPS has permissions set up differently so that the httpd process owner can't execute the mail sending part of the code. I haven't been able to locate the appropriate error log that may hint at the reason. Here is the code:
>>>BEGIN CODE>>>
#!/usr/bin/perl
use Mail::Sender;
use CGI;
use strict;
my $txt_msg = "This message is in HTML format. Please switch to HTML view in your email program.";
my $html_msg = $txt_msg;
my $sender = new Mail::Sender();
my $from = "orders\@rmspraying.com";
my $to = "brady\@brandnewgraphics.com";
my $subject = "Order Submitted";
if (ref $sender->OpenMultipart({
smtp => 'mail.rmspraying.com',
from => "$from",
to => "$to",
subject => "$subject",
auth => 'LOGIN',
authid => '[my username here]',
authpwd => '[my password here]',
multipart => 'related'})) {
$sender->Part({ctype => 'multipart/alternative'});
$sender->Part({ctype => 'text/plain', disposition => 'NONE', msg => $txt_msg});
$sender->Part({ctype => 'text/html', disposition => 'NONE', msg => $html_msg});
$sender->EndPart("multipart/alternative");
$sender->Close() or die "Close failed! $Mail::Sender::Error\n";
} else {
die "Cannot send mail: $Mail::Sender::Error\n";
}
my $q = new CGI;
print $q->header('text/html');
print "Hello, World!\n";
>>>END CODE>>>
The mail server that it is connecting to is located on my other VPS. I don't think that part is the issue since I can run this from the command line. Any ideas would be greatly appreciated!
Thanks,
Brady