I have problem with POP3Client&Sendmail Module, Please Help.

Discussion in 'Perl Misc' started by eng.john84@gmail.com, Apr 20, 2007.

  1. Guest

    The below code contain two modules POP3Client & Sendmail .
    The POP3Client used to get the subject from the header as numbers.
    The Sendmail used to send message to ( ) .
    The Problem how to print the subject from POP3Client to the email part
    ( ) at sendmail.


    <code>



    use Mail::Sendmail;

    use Mail::pOP3Client;


    $pop = new Mail::pOP3Client( USER => "xxxxxxxxxxx",
    PASSWORD => "xxxxxxxxxxx",
    HOST => "xxxxxxxxxxx" ),
    TIMEOUT => 1;
    for ($i = 1; $i <= $pop->Count(); $i++) {
    foreach ( $pop->Head( $i ) ) {
    /^Subject:.+\s(\d+)/i && print $1, "\n";
    }
    print "\n";
    }

    %mail = ( To => 'HOW TO PRINT THE SUBJECT(Numbers)
    ',
    From => 'xxxxxxxxxxxx',
    Subject => 'xxxxxxxxx',
    Message => 'John',
    );

    $mail{auth} = {user=>'xxxxxxxxx', password=>"xxxxxx", method=>"LOGIN",
    required=>0 };

    sendmail(%mail) or die $Mail::Sendmail::error;

    print "OK. Log says:\n", $Mail::Sendmail::log;



    </code>
     
    , Apr 20, 2007
    #1
    1. Advertising

  2. Guest

    Hi

    > The below code contain two modules POP3Client & Sendmail .
    > The POP3Client used to get the subject from the header as numbers.
    > The Sendmail used to send message to ( ) .
    > The Problem how to print the subject from POP3Client to the email part
    > ( ) at sendmail.

    [...]


    Try constructing a string that contains each recipient separated by
    commas (eg. ,,...),
    then use this string as the "To:" field.

    Example:

    my $numbers_string = "";
    for (my $i = 1; $i <= $pop->Count(); $i++) {
    foreach ( $pop->Head( $i ) ) {
    if (/^Subject:.+\s(\d+)/i) {
    $numbers_string += $1.",";
    }
    }
    }

    my %mail = ( To => $numbers_string,
    From => 'xxxxxxxxxxx',
    Subject => 'xxxxxxxxxxx',
    Message => 'John',
    );


    Regards,
    Yazeed
     
    , Apr 20, 2007
    #2
    1. Advertising

  3. Guest

    Hi

    > The below code contain two modules POP3Client & Sendmail .
    > The POP3Client used to get the subject from the header as numbers.
    > The Sendmail used to send message to ( ) .
    > The Problem how to print the subject from POP3Client to the email part
    > ( ) at sendmail.

    [...]


    Try constructing a string containing each recipient separated by a
    comma (eg. ,,....),
    then use this string as the "To:" field.

    Example:

    my $numbers_string = "";
    for (my $i = 1; $i <= $pop->Count(); $i++) {
    foreach ( $pop->Head( $i ) ) {
    if (/^Subject:.+\s(\d+)/i) {
    $numbers_string += $1.",";
    }
    }
    print "\n";

    }

    my %mail = ( To => $numbers_string,
    From => 'xxxxxxxxxxx',
    Subject => 'xxxxxxxxxxx',
    Message => 'John',
    );


    Regards,
    Yazeed
     
    , Apr 20, 2007
    #3
  4. Guest

    On Apr 20, 4:31 pm, wrote:
    > Hi
    >
    > > The below code contain two modules POP3Client & Sendmail .
    > > The POP3Client used to get the subject from the header as numbers.
    > > The Sendmail used to send message to ( ) .
    > > The Problem how to print the subject from POP3Client to the email part
    > > ( ) at sendmail.

    >
    > [...]
    >
    > Try constructing a string containing each recipient separated by a
    > comma (eg. ,,....),
    > then use this string as the "To:" field.
    >
    > Example:
    >
    > my $numbers_string = "";
    > for (my $i = 1; $i <= $pop->Count(); $i++) {
    > foreach ( $pop->Head( $i ) ) {
    > if (/^Subject:.+\s(\d+)/i) {
    > $numbers_string += $1.",";
    > }
    > }
    > print "\n";
    >
    > }
    >
    > my %mail = ( To => $numbers_string,
    > From => 'xxxxxxxxxxx',
    > Subject => 'xxxxxxxxxxx',
    > Message => 'John',
    > );
    >
    > Regards,
    > Yazeed









    Thanks for your help

    But when i trys the code it ype NO RECEPTION! .
     
    , May 2, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sugapablo
    Replies:
    0
    Views:
    2,198
    sugapablo
    Sep 21, 2007
  2. Andrzej Adam Filip
    Replies:
    0
    Views:
    4,182
    Andrzej Adam Filip
    Mar 31, 2008
  3. Paul
    Replies:
    4
    Views:
    177
    A. Sinan Unur
    Jul 11, 2005
  4. Replies:
    0
    Views:
    127
  5. Replies:
    5
    Views:
    114
    odhiseo
    Apr 13, 2007
Loading...

Share This Page