• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Simplest sendmail methods for idiots?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Simplest sendmail methods for idiots?

    Need to set up so can get orders via webtulipe. Not using horrible html mailto: that opens Outlook and preferably not having email address in complete string where it can be picked up by spammers.

    Don't want to fanny about for ages so 2nd part of this looked good:

    psp

    Course it did not work. Possibly psp not supported on Cobalt raq machines? Any ideas on that or simple alternatives for non server-side webby type appreciated.

    (I changed email addresses but left rest well alone as not familiar with psp syntax)

    #2
    use formmail.cgi - make up html and script would put things into email and send it to you - but for GODS sake rename the file as your site would look clearly amateur like for those in the know

    Comment


      #3
      Use the perl mongers version

      Perl Mongers formmail

      Otherwise you might get more rear entries than are normal even in Edinburgh - if you get my drift

      Comment


        #4
        The Cobalt Raq3 does not seem to come with PHP preloaded powerraq.com/datasheetraq3.pdf

        A simple way to check is to ftp this ...
        Code:
         
        <?php
            phpinfo();
        ?>
        as anyname.php then access it through a browser - if php is installed it will give you a shedload of info about the server - rather too much for the security concious so save it out and delete it from your server.

        Sending mail using php is extremely simple and more secure than putting perl scripts on the server which may (if not set up correctly) but used by spammers and cause you some grief.

        If you do have php and want to use it ask again and I'll post up some sample scripting.

        Comment


          #5
          Cheers to all.

          In fact I managed to get the perl in that ref working ok despite the author's deliberate error. As far as I can see, perl should be pizzacake for anyone who has done text parsing in C esp. using stdio.

          Checked and the site is supposedly set up for php which would prefer as it is far more trendy and generally koool. Will have another bash. Any sample scripts certainly useful.

          Recently juggling with VB, perl, Java script and php and even Pascal to cos the installation utility uses it. Needed to strip out CR from perl script to upload. Dirty prog in C++, piece of cake.Loaded VC++ and couldn't remember how to open or read files!

          As Homer Simpson said, everytime I learn something new it pushes some old stuff out!

          Comment


            #6
            Code:
                 
            <?php
            $msg = "";
            if ($from || $formmsg)
             {
              $from = trim($from);
              if (!$from)
                 $msg = "From eMail address missing.";
              else
               {
                if (!eregi("^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3}$", $from))
                   $msg = "From eMail address invalid.";
               }
            
              if (!$formmsg)
                 $msg .= "You have not entered a message.";
            
              if (!$msg)
               {
                 $eMail    = '[email protected]';
                 mail( "$eMail", "$subject" , $formmsg, "From: $from\r\nX-Mailer: DT_formmail" )    ;
                 $msg = "Your eMail has been sent";
               }
             }
            ?>
            
            Sample of the html form it's used with
            
                     <f0rm action="contact.php" method=post>
                     <p>
                        <?php
                          if ($msg) print "<span style='color : red; font-weight : bold;'>$msg</span>";
                        ?>
                     </p>
                     
            <table cellpadding="0" cellspacing="0" border="1" bordercolor="#7c2000"> <tr> <td> <table cellpadding="5" cellspacing="0" border="1" bordercolor="#EEBB00"> <tr> <td width="100%" bgcolor="#EEBB00"><p>Subject: <input type="text" size=40 name="subject" value="<?php print $subject;?>"></p></td> </tr> <tr> <td width="100%" bgcolor="#EEBB00"><p>Message:</p></td> </tr> <tr> <td width="100%" bgcolor="#EEBB00" align="center"><textarea name="formmsg" rows=10 cols=40><?php print $formmsg;?></textarea></td> </tr> <tr> <td width="100%" bgcolor="#EEBB00"><p>From (email) : <input type="text" size=40 name="from" value="<?php print $from;?>"></p></td> </tr> </table> </td> </tr> </table> <input name="send" type="image" src="images/icon_email.gif" alt="eMail" width="59" height="18" border="0">
            </f0rm>
            I've stripped some code out from what I actually use for clarity so the above is untested as-is. I've modified the form tag as ezboard objects to it. I've added some spaces in places to stop ezboard turning stuff into smilies.

            Comment


              #7
              Ta fiddle.I want to try and get website finished this weekend so will give that a go.

              Supplementary question. Is it possible to do string concatenation or partial substitution in HTML/php to avoid putting the email address in full so those spamming bastards don't pick it up?

              Comment


                #8
                A pox on ezpost, and ezpox's mother, their milkman etc :


                slap the usual script language tags round and replace the 1's with an 'i' and bob may be your uncle.

                javascript :




                var contact = "Xoggy"

                var email = "xoggy mail addy leftof at sign"

                var emailHost = "domain.com"

                var formatmail = '<a href=ma1lto:'


                document.wr1te (formatmail + email + "@" + emailHost+ ">" + contact + "</a>")


                you could use this :mailtoprotector.com/eprotector.shtml

                or have a search for php response forms.

                Comment


                  #9
                  Ta vetran.Should have thought of using Javascript as have been doing it recently to highlight buttons etc. Also previous comment which I missed.

                  PS Fiddle. Your php works. Cheers. All I need now is yet another reference book.

                  Let's see perl or php, perl or php? hmmmm I know, I'll stick in both. An application can never have too many languages!

                  Comment


                    #10
                    Put in some FORTRAN IV, Xogg.

                    You can use ASSIGNED GOTOs then.

                    And ARITHMETIC IFs.

                    Comment

                    Working...
                    X