Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Mailling module Help in direction

by zealf (Novice)
on Apr 24, 2010 at 14:41 UTC ( #836679=perlquestion: print w/replies, xml ) Need Help??
zealf has asked for the wisdom of the Perl Monks concerning the following question:

Hi everyone. I wanted to ask which mail mod is the preference out there.
I have attempted Sendmail but have an issue with the recepent email address.
I need to use a variable as the recepients email but I could not find out how to add the "\"

I will also to carry input variables to and from the email and a href link.

Any advice would be greatly appreciated.

Replies are listed 'Best First'.
Re: Mailling module Help in direction
by thezip (Vicar) on Apr 24, 2010 at 15:01 UTC

    I like MIME::Lite.

    What can be asserted without proof can be dismissed without proof. - Christopher Hitchens
      Thank you for your reply.
      Another Perl monk named Corion mantioned I should use CGI and little while ago. I did resist as the learning curb is already pretty big and having to relearn, well....
      I now fully understand the advantages of use CGI now, security and a much better use of variables.
      Bellow is my new and improved script. I have debugged though the command line and have had a syntax returned ok msg.
      How ever running off of the server I am getting 500 errors.
      Can anyone tell me the name of modules this script is using?.
      #!/usr/bin/perl use strict; use warnings; use diagnostics; use cgi qw(:standard); use CGI::Carp 'fatalsToBrowser'; $CGI::POST_MAX=1024 * 100; # max 100K posts my $query = CGI->new(); my @names = $query->param; foreach my $name ( @names ) { my $value = $query->param( $name ); } my $organisers_name=('organisers_name'); my $organisers_address=('organisers_address'); my $organisers_homeN=('organisers_homeN'); my $organisers_mobile=('organisers_mobile'); my $organisers_email=('organisers_email'); my $prefered_contact=('prefered_contact'); my $brides_name=('brides_name'); my $brides_number=('brides_number'); my $wedding_date=('wedding_date'); my $bride_organiser=('bride_organiser'); my $suprise=('suprise'); print <<print_tag; <html> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http:/ +/"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" > <title>$organisers_name Hens party with The Man in the Charcoal Suit b +ooking page</title> <link rel="stylesheet" type="text/css" href="../web_layout.css" > </head> <body onLoad="MM_preloadImages('buttons/list-off.jpg','buttons/list-on +.jpg','buttons/list-active.jpg')"> <div id="everything1"> <div id="top_text"> </div> <div id="left"> <div id="navcontainer"> <ul id="navlist"> <li><a href="../index.html"><img src="../images/Logo_p +ic.jpg" width="70" height="176" border="0"></a></li> <br> <li><a><img src="../images/icons/bookings.jpg" width=" +70" height="70" border="0" hspace="0"></a></li> <li><a href="../bookings.html">Booking office</a></li> <br> <li><a href="../comments.html"><img src="../images/ico +ns/comments.jpg" width="70" height="70" border="0" hspace="0"></a></l +i> <li><a href="../comments.html">Testimonials</a></li> <br> <li><a href="../contact.html"><img src="../images/icon +s/contact.jpg" width="70" height="70" border="0" hspace="0"></a></li> <li><a href="../contact.html">Contact Us</a></li> </ul> </div> </div> <div id="side_pic"></div> <div id="main1"> <img src="../images/booking_steps/step1.jpg" align="right"> <br> <p1><b1>So far so Good.</b1><br> <p1>Below lists the details that you have entered so far. <br> <b1>PLEASE CHECK THESE CAREFULLY</b1> <br> <p1>If everything is ok click the "proceed" button or the "return" + button to correct anything.<p1> <br> <br> <form method="post" action="bookings2.cgi"> <hr> <h1>Your details</h1> <p1>$organisers_name<br> <p1>$organisers_address<br> <p1>$organisers_homeN<br> <p1>$organisers_mobile<br> <p1>$organisers_email<br> <p1>How do you preferr to be contacted $prefered_contact<br> <br> <hr> <h1>The Bride to be's details</h1> <p1>$brides_name<br> <p1>$brides_number<br> <p1>The date of the wedding? $wedding_date<br> <p1>Is the Bride organising this party? $bride_organiser<br> <p1>Is this a suprise party for the Bride? $suprise<br> <hr> <INPUT TYPE="hidden" NAME="organisers_name" VALUE="$organisers_nam +e"> <INPUT TYPE="hidden" NAME="organisers_address" VALUE="$organisers_ +address"> <INPUT TYPE="hidden" NAME="organisers_homeN" VALUE="$organisers_ho +meN"> <INPUT TYPE="hidden" NAME="organisers_mobile" VALUE="$organisers_m +obile"> <INPUT TYPE="hidden" NAME="organisers_email" VALUE="$organisers_em +ail"> <INPUT TYPE="hidden" NAME="prefered_contact" VALUE="$prefered_cont +act"> <INPUT TYPE="hidden" NAME="brides_name" VALUE="$brides_name"> <INPUT TYPE="hidden" NAME="brides_number" VALUE="$brides_number"> <INPUT TYPE="hidden" NAME="wedding_date" VALUE="$wedding_date"> <INPUT TYPE="hidden" NAME="bride_organiser" VALUE="$bride_organise +r"> <INPUT TYPE="hidden" NAME="suprise" VALUE="suprise"> <INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return t +rue;"> <INPUT type="submit" value="Proceed to Step 2"> </FORM> </div> </div> </body> </html> print_tag

        A few things. Firstly cgi-lib is old, very old. Please do not use this, it has some nasty security flaws and IIRC isn't 100% compliant with the CGI specification. Use the CGI module, it will be well worth the short time taken to replace cgi-lib. Secondly, your code is missing:

        use strict; use warnings;

        See Use strict and warnings.

        On to your question. For your example above, does your script receive the input correctly? If I where you, I'd do the following:

        After this is you have further problems please let us know.

        Hope this helps.

Re: Mailling module Help in direction
by halfcountplus (Hermit) on Apr 24, 2010 at 16:40 UTC
    Be aware that currently most ISP's whitelist who they will receive mail from. This means you cannot effectively send mail directly from an SMTP server (such as Sendmail) unless:

    1) you use a proxy service
    2) you are whitelisted

    So if that's what you are hoping to do, you are going to waste a lot of time getting this working only to find most of the mail you send bounces.
Re: Mailling module Help in direction
by Anonymous Monk on Apr 24, 2010 at 15:32 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://836679]
Approved by moritz
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2017-03-29 22:59 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (353 votes). Check out past polls.