Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomly fails to return from try_to_sendmail call. #43

Open
geekdad1 opened this issue May 4, 2016 · 0 comments
Open

Randomly fails to return from try_to_sendmail call. #43

geekdad1 opened this issue May 4, 2016 · 0 comments

Comments

@geekdad1
Copy link

geekdad1 commented May 4, 2016

I have a perl script run from a web form that create 1 to n emails. I was hoping Email::Sender would be more efficient than calling sendmail directly. However I have a problem in that the email sometimes go and other times they fail to return and the script times out.

here is a partial program sample:
use Email::Sender::Simple qw(try_to_sendmail);
use Email::Simple;
use Email::Simple::Creator;
use Data::Dumper;
use CGI;
$q = new CGI;
...
my $to = """ . $user{user_name} . "" <$user{email}>";
print "sending to $to\n";
my $msg = Email::Simple->create(
header => [
To => $to,
From => '[email protected]',
Subject => 'Login for PharmaNet',
],
body => $body,
);
print Dumper($msg);
my $res = eval {
try_to_sendmail($msg);
};
print "sent $res\n";


Here is the output from a failed attempt:
sending to "Emergency, Demo Account" [email protected]
$VAR1 = bless( {
'body' => 'You have requested a password reset
on 2016/05/04 10:56:05.


If you did not request this, then you should contact your supervisor
immediately to report this.

Click Here
to reset your password.


Your User ID will already be filled in.


Thank you


Medinet Support Staff
',
'mycrlf' => '
',
'header' => bless( {
'headers' => [
'To',
[
'"Emergency, Demo Account" [email protected]',
'To: "Emergency, Demo Account" [email protected]'
],
'From',
[
'[email protected]',
'From: [email protected]'
],
'Subject',
[
'Login for PharmaNet',
'Subject: Login for PharmaNet'
],
'Date',
'Wed, 4 May 2016 10:56:05 -0700'
],
'mycrlf' => '
'
}, 'Email::Simple::Header' )
}, 'Email::Simple' );

It should get to the sent $res statement but it doesn't

There is nothing in the webserver logs to suggest there is a problem, other than it will quit once the timeout occurs.
I just downloaded the most recent version through CPAN.
I'm running an Apache web server and a pretty standard sendmail.

Is there something obvious I'm missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant