473,385 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Email server timing out in email script

I have a perl script running on machine A, a web server. A visitor
completes certain pieces of data and these are compiled into two emails, one
addressed to the visitor and copied to the site owner, the other addressed
to the webmaster and including cookie and timing data for debugging.

The email is sent by machine B which is the email server for the domain.
Here are some config values for the perl script, names have been changed to
protect the innocent.

my $smtp_server = "pennyblack";
my $smtp_domain = "fred.fred.fred.fred";
my $MailFrom = "domain\@fred.fred.fred";
my $MailTo = "owner\@fred.fred.fred";

The opening part of the perl script is as follows:

sub psendmail()
{

use Net::SMTP;

# connect to an SMTP server
$smtp = Net::SMTP->new( $smtp_server, Hello => $smtp_domain, Timeout =>
10, Debug => 1);
if ( !$smtp ) { return 1; }
die "Couldn't connect psendmail to email server" unless $smtp;

$smtp->mail( $MailFrom); # use the sender's real address here
$smtp->to( $MailTo); # recipient's real address
$smtp->data(); # Start the mail

# Send the header.
$smtp->datasend("To: $MailTo\n"); # address in the email view
$smtp->datasend("From: $MailFrom\n"); #address in the email view

And here is the end of the process.

$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection

return 0;
The email server is being opened in debug while I fix some issues, and the
short timeout is because of the following messages in the log, which had
been around 2 minutes each prior to my changing them.

Net::SMTP>>>
Net::SMTP(2.26)
Net::SMTP>>> Net::Cmd(2.24)
Net::SMTP>>> Exporter(5.57)
Net::SMTP>>> IO::Socket::INET(1.27)
Net::SMTP>>> IO::Socket(1.28)
Net::SMTP>>> IO::Handle(1.23)
Net::SMTP=GLOB(0x1ab6c08)<<< 220 fred.fred.fred.fred ESMTP MailEnable
Service, Version: 0-1.17- ready at 02/04/05 18:14:25
Net::SMTP=GLOB(0x1ab6c08)>>> EHLO fred.fred.fred.fred
Net::SMTP=GLOB(0x1ab6c08)<<< 250-fred.fred.fred.fred [10.0.0.27], this
server offers 4 extensions
Net::SMTP=GLOB(0x1ab6c08)<<< 250-AUTH LOGIN
Net::SMTP=GLOB(0x1ab6c08)<<< 250-SIZE 5120000
Net::SMTP=GLOB(0x1ab6c08)<<< 250-HELP
Net::SMTP=GLOB(0x1ab6c08)<<< 250 AUTH=LOGIN
Net::SMTP=GLOB(0x1ab6c08)>>> MAIL FROM:
Net::SMTP=GLOB(0x1ab6c08)<<< 250 Requested mail action okay, completed
Net::SMTP=GLOB(0x1ab6c08)>>> RCPT TO: [Fri Feb 4 18:14:36 2005]
applymail.cgi:
Net::SMTP=GLOB(0x1ab6c08): Timeout at C:/ .. obfuscated path ..
/cgi-bin/applymail.cgi line 210
Net::SMTP=GLOB(0x1ab6c08)>>> DATA [Fri Feb 4 18:14:46 2005] applymail.cgi:
Net::SMTP=GLOB(0x1ab6c08): Timeout at C:/ .. obfuscated path ..
/cgi-bin/applymail.cgi line 211
Net::SMTP=GLOB(0x1ab6c08)>>> To: ow***@fred.fred.fred
Net::SMTP=GLOB(0x1ab6c08)>>> From: do****@fred.fred.fred

The email is being delivered, and where I have used a CC: definition on the
email to an external email service, this too has worked. This suggests the
email server is doing its job, yet the closure of the message also suggests
there is an issue. I need, at the very least, to get the time down for this
process, four timeouts on each of two mail sends means the script is taking
more than 80 seconds to run, and most of that is timeout.

Following is the closure part of the log. My apparently valid statements
above are also causing issues. There are no errors in any [part of the data
send.

Net::SMTP=GLOB(0x1ab6c08)>>> . [Fri Feb 4 18:14:56 2005] applymail.cgi:
Net::SMTP=GLOB(0x1ab6c08): Timeout at C:/ .. obfuscated path ..
/cgi-bin/applymail.cgi line 262
Net::SMTP=GLOB(0x1ab6c08)>>> QUIT [Fri Feb 4 18:15:06 2005] applymail.cgi:
Net::SMTP=GLOB(0x1ab6c08): Timeout at C:/ .. obfuscated path ..
/cgi-bin/applymail.cgi line 263
Kind regards

John

Jul 19 '05 #1
0 4512

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Shabam | last post by:
Ok I'm trying to run a php script written by someone else, not me, and it's getting stuck in a particular step. Actually it isn't getting stuck per se, but the browser is, because it's taking...
6
by: Jeffrey Silverman | last post by:
Hi, all. Sorry, first off, for the kidna weird selection of crossposted groups, but this question touches on aspects of discussion in each of the groups. So I have a group of around 500 email...
4
by: Bill | last post by:
Is it possible to somehow activate a page containing a php script by sending an email to a mailbox on the server? I have a script that sends out notification emails to an individual. He wants to...
6
by: bojanraic | last post by:
Hi! I recently started playing with Python CGI, and I was happy that my basic input-name--print-hello-name CGI form example worked, so I thought I should advance to somew\hat more complicated...
2
by: Mindful_Spirit | last post by:
I'm trying to set up a basic email feed back form like this, and was wondering about some basic configuration settings. I have used code from this website. I have it working just fine. I'm...
5
by: Bryan Field-Elliot | last post by:
We're designing a web app in which some operations will take a long time to complete (maybe two minutes). Because it's a high-volume application, we don't want browser connections hanging open for...
3
by: Russell | last post by:
I have a quirky issue that I believe involves timing and only 2 hairs left to pull. I have a modal dialog that is an IFrame. The IFrame contains another window - which contains the appropriate...
2
by: SQL Server Questions | last post by:
Environment: Server1 (Local) OS Windows 2000 Server SQL Server 2000 Server2 (Remote) OS Windows 2003 Server SQL Server 2000 (Both with most recent service packs)
5
by: ozzii | last post by:
Hi, I have a asp email script which uses cdosys to send emails with attahcments by iterating through a record set of 500 email addresses. However the script simply times out. I know you can...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.