Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. CGI/PERL Email

CGI/PERL Email

Scheduled Pinned Locked Moved IT & Infrastructure
perlsysadminhelpquestion
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevnar
    wrote on last edited by
    #1

    Are there any libraries in PERL that send mail with an IMAP server? The Mail::Mailer library can only send from an SMTP server. Please help! Why not throw away a dime? I throw away ten pennies all the time.

    P 1 Reply Last reply
    0
    • K Kevnar

      Are there any libraries in PERL that send mail with an IMAP server? The Mail::Mailer library can only send from an SMTP server. Please help! Why not throw away a dime? I throw away ten pennies all the time.

      P Offline
      P Offline
      perlmunger
      wrote on last edited by
      #2

      IMAP is intended for retrieving mail--or more specifically for allowing you to manage your received email on the server from your remote client machine. SMTP is all you've got for sending mail as far as I know. Let me know what you're wanting to do and what the issue is with using SMTP. A package that I prefer is Mail::Sendmail. It still requires SMTP, but you don't have to be running your own SMTP server. Just create a new Mail::Sendmail message with the appropriate SMTP server specified and it'll work. Take a look at: http://search.cpan.org/search?dist=Mail-Sendmail http://search.cpan.org/doc/MIVKOVIC/Mail-Sendmail-0.78/Sendmail.html If you have more specific questions, let me know. -Matt

      K 1 Reply Last reply
      0
      • P perlmunger

        IMAP is intended for retrieving mail--or more specifically for allowing you to manage your received email on the server from your remote client machine. SMTP is all you've got for sending mail as far as I know. Let me know what you're wanting to do and what the issue is with using SMTP. A package that I prefer is Mail::Sendmail. It still requires SMTP, but you don't have to be running your own SMTP server. Just create a new Mail::Sendmail message with the appropriate SMTP server specified and it'll work. Take a look at: http://search.cpan.org/search?dist=Mail-Sendmail http://search.cpan.org/doc/MIVKOVIC/Mail-Sendmail-0.78/Sendmail.html If you have more specific questions, let me know. -Matt

        K Offline
        K Offline
        Kevnar
        wrote on last edited by
        #3

        Well I've tried this mail modules back and forth and upside down, everywhich way possible. Four hours later, all I've gotten is it to run through my code without errors, only to do nothing at all. ie. no email is sent. I've tried every possible configuration I can think of and nothing works. The funny thing is, the test.pl program that came with the module works. Go figure! :confused: :mad: X| Why not throw away a dime? I throw away ten pennies all the time.

        P 1 Reply Last reply
        0
        • K Kevnar

          Well I've tried this mail modules back and forth and upside down, everywhich way possible. Four hours later, all I've gotten is it to run through my code without errors, only to do nothing at all. ie. no email is sent. I've tried every possible configuration I can think of and nothing works. The funny thing is, the test.pl program that came with the module works. Go figure! :confused: :mad: X| Why not throw away a dime? I throw away ten pennies all the time.

          P Offline
          P Offline
          perlmunger
          wrote on last edited by
          #4

          Can you send me your script? I'll be glad to take a look and see if it'll work for me. Also, I need to know if you have access to an SMTP server. If not, the Mail::Sendmail module won't work. While I'm not necessarily suggesting you do this, a lot of companies have their SMTP servers setup such that they require no authentication. You could really use any SMTP server that is 1) accessible to you on the internet and 2) is not set up to authenticate its users. Just FYI. Use at your own risk. -Matt

          K 1 Reply Last reply
          0
          • P perlmunger

            Can you send me your script? I'll be glad to take a look and see if it'll work for me. Also, I need to know if you have access to an SMTP server. If not, the Mail::Sendmail module won't work. While I'm not necessarily suggesting you do this, a lot of companies have their SMTP servers setup such that they require no authentication. You could really use any SMTP server that is 1) accessible to you on the internet and 2) is not set up to authenticate its users. Just FYI. Use at your own risk. -Matt

            K Offline
            K Offline
            Kevnar
            wrote on last edited by
            #5

            Well my recieving server is an IMAP server, I'm assuming the sending server is smtp since the Test.pl file worked with my mail server's domain name included. I tried a couple of different code snippets to get it going neither worked. (domains and emails have been changed.) 1) use Mail::Mailer; $mailer = Mail::Mailer->new("smtp", "mail.myserver.com"); $mailer->open({ From => 'me@hotmail.com', To => 'you@hotmail.com, Subject => 'Test', }) or die "Failed!"; print $mailer "This is a test!"; $mailer->close(); 2) open(SENDMAIL, "|C:/Perl/lib/mail/sendmail -oi -t -odq") or die "failed here too!"; print SENDMAIL <<"EOT"; From: Me <me\@hotmail.com> To: You <you\@hotmail.com> Subject: Test This is also a test! EOT ; close(SENDMAIL); My only guess is that I didn't install the modules correctly, but then why would the test.pl program work? Why not throw away a dime? I throw away ten pennies all the time.

            P 1 Reply Last reply
            0
            • K Kevnar

              Well my recieving server is an IMAP server, I'm assuming the sending server is smtp since the Test.pl file worked with my mail server's domain name included. I tried a couple of different code snippets to get it going neither worked. (domains and emails have been changed.) 1) use Mail::Mailer; $mailer = Mail::Mailer->new("smtp", "mail.myserver.com"); $mailer->open({ From => 'me@hotmail.com', To => 'you@hotmail.com, Subject => 'Test', }) or die "Failed!"; print $mailer "This is a test!"; $mailer->close(); 2) open(SENDMAIL, "|C:/Perl/lib/mail/sendmail -oi -t -odq") or die "failed here too!"; print SENDMAIL <<"EOT"; From: Me <me\@hotmail.com> To: You <you\@hotmail.com> Subject: Test This is also a test! EOT ; close(SENDMAIL); My only guess is that I didn't install the modules correctly, but then why would the test.pl program work? Why not throw away a dime? I throw away ten pennies all the time.

              P Offline
              P Offline
              perlmunger
              wrote on last edited by
              #6

              Try this: # --------------------- use Mail::Sendmail; my %mail = ( To => 'you@hotmail.com', From => 'me@hotmail.com', Subject => "Test" Message => "This is also a test!", Smtp => "mail.myserver.com" ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log; # ---------------------- Obviously, you'll need to get the Mail::Sendmail module from CPAN, but it is available for both Windows and Linux/Unix through PPM and the CPAN shell respectively. If you have questions about using PPM (for windows) or the CPAN shell (for linux/unix), see below. -Matt --------------------------------------------- Using PPM: At a windows command prompt, type: C:\> ppm you'll then get a prompt like this: PPM interactive shell (2.1.5) - type 'help' for available commands. PPM> Just type: PPM> install Mail::Sendmail Using CPAN shell: At a linux/unix command prompt (as root) type: bash% perl -MCPAN -e shell If this is the first time you've done this, you'll be prompted to answer some questions. Just accept all the defaults. Then you will see the prompt: cpan> Just type: cpan> install Mail::Sendmail Now the above script should work! p.s. If you don't have ActiveState Perl on windows, you won't have ppm. You may want to use ActiveState perl if you're not.

              K 1 Reply Last reply
              0
              • P perlmunger

                Try this: # --------------------- use Mail::Sendmail; my %mail = ( To => 'you@hotmail.com', From => 'me@hotmail.com', Subject => "Test" Message => "This is also a test!", Smtp => "mail.myserver.com" ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log; # ---------------------- Obviously, you'll need to get the Mail::Sendmail module from CPAN, but it is available for both Windows and Linux/Unix through PPM and the CPAN shell respectively. If you have questions about using PPM (for windows) or the CPAN shell (for linux/unix), see below. -Matt --------------------------------------------- Using PPM: At a windows command prompt, type: C:\> ppm you'll then get a prompt like this: PPM interactive shell (2.1.5) - type 'help' for available commands. PPM> Just type: PPM> install Mail::Sendmail Using CPAN shell: At a linux/unix command prompt (as root) type: bash% perl -MCPAN -e shell If this is the first time you've done this, you'll be prompted to answer some questions. Just accept all the defaults. Then you will see the prompt: cpan> Just type: cpan> install Mail::Sendmail Now the above script should work! p.s. If you don't have ActiveState Perl on windows, you won't have ppm. You may want to use ActiveState perl if you're not.

                K Offline
                K Offline
                Kevnar
                wrote on last edited by
                #7

                After I had sent the last message, that's exactly what I did and it worked. I decided to imitate the program that worked. I should have done that in the first place. :rolleyes: Thanks for your help. Why not throw away a dime? I throw away ten pennies all the time.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups