Problematic delay in script

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default Problematic delay in script

    Hello, I have created a mailing program for our company that sends out
    emails to our client database. There seems to be a delay in the script or
    the processing of the emails. Here is how it works. The email addresses are
    stored in a simple text file, one on top of each other. Each email is sent
    through a foreach loop. I use this code to get email addresses and send the
    emails:

    open (ADDRESSES, "<address.txt") or die "Can't open file: $!";
    @list=<ADDRESSES>;
    close(ADDRESSES);

    $mailprog="/usr/sbin/sendmail -t";

    foreach $list (@list) {
    chomp ($list);
    ($name,$email)=split(/\|/,$list);

    open (MAIL, "|$mailprog") or die "Can't open main program: $!";
    print MAIL "From: $adminname <$adminemail>\n";
    print MAIL "To: $fullname <$email>\n";
    print MAIL "Subject: $subject\n";
    print MAIL "MIME-Version: 1.0\n";
    print MAIL "X-MSMail-Priority: $priority\n";
    print MAIL "Content-Type: multipart/alternative;\n";
    print MAIL " boundary=\"separator\"\n\n";
    print MAIL "This is a multi-part message in MIME format.\n\n";
    print MAIL "--separator\n";
    print MAIL "Content-Type: text/plain;\n";
    print MAIL " charset=\"iso-8859-1\"\n\n";
    print MAIL "@textonly\n\n";
    print MAIL "--separator\n";
    print MAIL "Content-Type: text/html;\n";
    print MAIL " charset=\"iso-8859-1\"\n\n";
    print MAIL "@content\n\n";
    print MAIL "--separator--";
    close (MAIL);
    }

    print "Confirmation Message";

    For testing purposes, the address.txt file contains 100 email addresses ...
    all different, but in the end end up in my inbox ... so if I recieve 100
    emails the script works. Well it does ... I do get the 100 emails but heres
    the thing ... almost right away I get about 60-70 emails ... but then the
    other 30 seem to get delivered at random intervals. Some take 5 minutes,
    some take 5 hours. I am puzzled why so many take so long to get delivered?
    Am I overloading sendmail? or maybe my email account? Your
    thoughts/reccommendations are appriciated.

    Randy


    \Dandy\ Randy Guest

  2. Similar Questions and Discussions

    1. Conversion from 1.5 to 2.0 problematic
      I'm having trouble converting documents from InDesign 1.5 to 2.0 -- during the "Open Document" phase, the "converting data" bar gets to about 35% and...
    2. Fwd: [PHP-DEV] ZEND_DISABLE_MEMORY_CACHE=0 problematic on
      FYI, this should be fixed now. If anyone still bumps into weird performance problems relating to the memory manager please let me know. Andi ...
    3. [PHP-DEV] ZEND_DISABLE_MEMORY_CACHE=0 problematic on large arrays
      http://cvs.php.net/diff.php/ZendEngine2/zend_alloc.c?r1=1.118&r2=1.119&ty=h&num=10 " - Add heap to memory manager. This should improve...
    4. Problematic Postbacks
      this may be a stupid response, after updating the database, how about rebounding the label ? news.microsoft.com wrote:
    5. problematic behaviour of movies using XML parser scripts in shockwave - !!!
      hi, all! we are in the process of testing XML parsing in shockwave and publishing some movies on the internet, that all of them use the XML...
  3. #2

    Default Re: Problematic delay in script

    \"Dandy\" Randy <ducott@hotmail.com> wrote:
    > Hello, I have created a mailing program for our company that sends out
    > emails to our client database.
    > Your
    > thoughts/reccommendations are appriciated.

    use Mail::Bulkmail;


    --
    Tad McClellan SGML consulting
    [email]tadmc@augustmail.com[/email] Perl programming
    Fort Worth, Texas
    Tad McClellan Guest

  4. #3

    Default Re: Problematic delay in script

    Just for test... try halving your database....i.e. send two chunks of
    50 emails. Does the first 50 go through ok? The second? or does it
    stop at 20 or so and spit the remainder 30 out at intermittent
    intervals?

    -Beau Schwabe
    >Hello, I have created a mailing program for our company that sends out
    >emails to our client database. There seems to be a delay in the script or
    >the processing of the emails. Here is how it works. The email addresses are
    >stored in a simple text file, one on top of each other. Each email is sent
    >through a foreach loop. I use this code to get email addresses and send the
    >emails:
    >
    >open (ADDRESSES, "<address.txt") or die "Can't open file: $!";
    > @list=<ADDRESSES>;
    >close(ADDRESSES);
    >
    >$mailprog="/usr/sbin/sendmail -t";
    >
    >foreach $list (@list) {
    >chomp ($list);
    >($name,$email)=split(/\|/,$list);
    >
    >open (MAIL, "|$mailprog") or die "Can't open main program: $!";
    >print MAIL "From: $adminname <$adminemail>\n";
    >print MAIL "To: $fullname <$email>\n";
    >print MAIL "Subject: $subject\n";
    >print MAIL "MIME-Version: 1.0\n";
    >print MAIL "X-MSMail-Priority: $priority\n";
    >print MAIL "Content-Type: multipart/alternative;\n";
    >print MAIL " boundary=\"separator\"\n\n";
    >print MAIL "This is a multi-part message in MIME format.\n\n";
    >print MAIL "--separator\n";
    >print MAIL "Content-Type: text/plain;\n";
    >print MAIL " charset=\"iso-8859-1\"\n\n";
    >print MAIL "@textonly\n\n";
    >print MAIL "--separator\n";
    >print MAIL "Content-Type: text/html;\n";
    >print MAIL " charset=\"iso-8859-1\"\n\n";
    >print MAIL "@content\n\n";
    >print MAIL "--separator--";
    >close (MAIL);
    >}
    >
    >print "Confirmation Message";
    >
    >For testing purposes, the address.txt file contains 100 email addresses ...
    >all different, but in the end end up in my inbox ... so if I recieve 100
    >emails the script works. Well it does ... I do get the 100 emails but heres
    >the thing ... almost right away I get about 60-70 emails ... but then the
    >other 30 seem to get delivered at random intervals. Some take 5 minutes,
    >some take 5 hours. I am puzzled why so many take so long to get delivered?
    >Am I overloading sendmail? or maybe my email account? Your
    >thoughts/reccommendations are appriciated.
    >
    >Randy
    >
    >
    Beau Schwabe Guest

  5. #4

    Default Re: Problematic delay in script

    \"Dandy\" Randy <ducott@hotmail.com> wrote:
    > print MAIL "@content\n\n";

    That adds space characters to the body of the email message.

    Is that what you want it to do?



    perldoc -q spaces

    Why do I get weird spaces when I print an array of lines?


    --
    Tad McClellan SGML consulting
    [email]tadmc@augustmail.com[/email] Perl programming
    Fort Worth, Texas
    Tad McClellan Guest

  6. #5

    Default Re: Problematic delay in script

    Yes, this \n\n is required at the end of the html body content, otherwise
    the multipart html will send process the separators correctly.

    "Tad McClellan" <tadmc@augustmail.com> wrote in message
    news:slrnbmhd2t.89l.tadmc@magna.augustmail.com...
    > \"Dandy\" Randy <ducott@hotmail.com> wrote:
    >
    > > print MAIL "@content\n\n";
    >
    >
    > That adds space characters to the body of the email message.
    >
    > Is that what you want it to do?
    >
    >
    >
    > perldoc -q spaces
    >
    > Why do I get weird spaces when I print an array of lines?
    >
    >
    > --
    > Tad McClellan SGML consulting
    > [email]tadmc@augustmail.com[/email] Perl programming
    > Fort Worth, Texas

    \Dandy\ Randy Guest

  7. #6

    Default Re: Problematic delay in script

    > use Mail::Bulkmail;

    I do not believe my hosting company had this module installed.

    R


    \Dandy\ Randy Guest

  8. #7

    Default Re: Problematic delay in script

    [TOFU rearranged to proper chronological order. Please don't do
    that.]

    "Dandy" Randy <ducott@hotmail.com> wrote:
    >
    > "Tad McClellan" <tadmc@augustmail.com> wrote in message
    > news:slrnbmhd2t.89l.tadmc@magna.augustmail.com...
    >> \"Dandy\" Randy <ducott@hotmail.com> wrote:
    >>
    >> > print MAIL "@content\n\n";
    >>
    >>
    >> That adds space characters to the body of the email message.
    >>
    >> Is that what you want it to do?
    >>
    >>
    >> perldoc -q spaces
    >>
    >> Why do I get weird spaces when I print an array of lines?
    > Yes, this \n\n is required at the end of the html body content,
    > otherwise the multipart html will send process the separators
    > correctly.
    The "\n\n" is not what Tad was talking about. If you read the FAQ
    entry he referred to you'll see what Tad was asking.

    --
    David Wall
    David K. Wall Guest

  9. #8

    Default Re: Problematic delay in script

    "Beau Schwabe" <bschwabe@atlanta.nsc.com> wrote
    news:3f68b315.19230392@usenet.nsc.com...
    > Just for test... try halving your database....i.e. send two chunks of
    > 50 emails. Does the first 50 go through ok? The second? or does it
    > stop at 20 or so and spit the remainder 30 out at intermittent
    > intervals?
    Beau, I did a test a you suggested ...

    Test #1
    Sent: 50 emails all to my inbox
    Result: All 50 delivered timely ... within 30 seconds

    --- Waiting 2 minutes before next test

    Test #2
    Sent: 50 emails all to my inbox (again, same addresses)
    Result: 49 delivered timely ... within 30 seconds. 1 email has not arrived.
    most likely will at some point

    --- Waiting 2 minutes before next test

    Test #3
    Sent: 100 emails all to my inbox (same addresses)
    Result: 85 delivered timely ... within 30 seconds. 15 emails have not
    arrived.


    \Dandy\ Randy Guest

  10. #9

    Default Re: Problematic delay in script

    \"Dandy\" Randy <ducott@hotmail.com> wrote:
    >> use Mail::Bulkmail;
    >
    > I do not believe my hosting company had this module installed.

    Then install it yourself.


    --
    Tad McClellan SGML consulting
    [email]tadmc@augustmail.com[/email] Perl programming
    Fort Worth, Texas
    Tad McClellan Guest

  11. #10

    Default Re: Problematic delay in script

    > > I do not believe my hosting company had this module installed.
    >
    >
    > Then install it yourself.
    ???


    \Dandy\ Randy Guest

  12. #11

    Default Re: Problematic delay in script

    On Wed, 17 Sep 2003 22:59:58 GMT, \"Dandy\" Randy <ducott@hotmail.com> wrote:
    >> > I do not believe my hosting company had this module installed.
    >>
    >>
    >> Then install it yourself.
    >
    > ???
    RTFM

    perldoc -q module

    --
    Sam Holden
    Sam Holden Guest

  13. #12

    Default Re: Problematic delay in script

    "Sam Holden" <sholden@flexal.cs.usyd.edu.au> wrote in message
    > RTFM
    >
    > perldoc -q module
    Sam, I don't actually have perl installed locally, so I dont have access to
    perldoc information other than what I find on [url]www.perldoc.com[/url] ... could you
    post instruction? TIA!

    R


    \Dandy\ Randy Guest

  14. #13

    Default Re: Problematic delay in script

    \"Dandy\" Randy wrote:
    > Sam, I don't actually have perl installed locally, so I dont have access to
    > perldoc information other than what I find on [url]www.perldoc.com[/url] ... could you
    > post instruction? TIA!
    You're not trying very hard. If you've got access to the documentation
    on the web, go to the FAQ and try searching for the obvious: "install"
    (success on the first hit) or "module" (third hit) or "CPAN" (first
    hit) ...

    Chief S.
    Chief Squawtendrawpet Guest

  15. #14

    Default Re: Problematic delay in script

    "\"Dandy\" Randy" <ducott@hotmail.com> writes:
    > "Sam Holden" <sholden@flexal.cs.usyd.edu.au> wrote in message
    >> RTFM
    >>
    >> perldoc -q module
    >
    > Sam, I don't actually have perl installed locally, so I dont have access to
    > perldoc information other than what I find on [url]www.perldoc.com[/url] ... could you
    > post instruction? TIA!
    Perl can be installed on every operating system I personally can
    conceive of you actually running. So go out and install it today!
    Among the many benefits, you will gain the ability to test your perl
    programs before uploading them to your hosting provider (This is so
    useful, I can't imagine why anybody would not want to do this), and a
    local copy of the latest and greatest Perl documentation that you are
    guaranteed matches what is installed.

    I'm not going to bother posting the URL on perldoc.com because:

    A) Somebody else probably will anyway.
    B) You're more than capable, and unlike me, you care.

    But it's on there. Have fun.

    -=Eric
    --
    Come to think of it, there are already a million monkeys on a million
    typewriters, and Usenet is NOTHING like Shakespeare.
    -- Blair Houghton.
    Eric Schwartz Guest

  16. #15

    Default Re: Problematic delay in script

    On Thu, 18 Sep 2003 00:03:08 GMT, \"Dandy\" Randy <ducott@hotmail.com> wrote:
    > "Sam Holden" <sholden@flexal.cs.usyd.edu.au> wrote in message
    >> RTFM
    >>
    >> perldoc -q module
    >
    > Sam, I don't actually have perl installed locally, so I dont have access to
    > perldoc information other than what I find on [url]www.perldoc.com[/url] ... could you
    > post instruction? TIA!
    The Laziness virtue is about reducing overall work, not reducing your own work
    by getting others to do trivial things for you.

    --
    Sam Holden

    Sam Holden Guest

  17. #16

    Default Re: Problematic delay in script

    \"Dandy\" Randy <ducott@hotmail.com> wrote:
    > I don't actually have perl installed locally,

    Why not?


    --
    Tad McClellan SGML consulting
    [email]tadmc@augustmail.com[/email] Perl programming
    Fort Worth, Texas
    Tad McClellan Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139