CGI/PERL Email
-
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.
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
-
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
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.
-
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.
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
-
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
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.
-
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.
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.
-
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.
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.