Loading ...
Sorry, an error occurred while loading the content.

Sendmail

Expand Messages
  • Mark Weston
    I recently moved to another host and have found out that they do not have sendmail on the server. Instead clients are required to use the smtp of their ISP s.
    Message 1 of 30 , Dec 10, 2000
    • 0 Attachment
      I recently moved to another host and have found out that they do not have
      sendmail on the server. Instead clients are required to use the smtp of
      their ISP's.
      I have a few cgi scripts which require the path to sendmail on the server.
      Is there a way to point to the smtp on my ISP in the cgi script?
      $mailprog = '/usr/sbin/sendmail'; How could I point to smtp1@...?
      Regards,
      Mark
      http://SiriusDog.com
      mark@...
    • Franki
      I use the Sender.pm lib so that clients of our system that use our checkout script can get their email regardless of the server setup. Look up Sender.pm with a
      Message 2 of 30 , Dec 10, 2000
      • 0 Attachment
        I use the Sender.pm lib so that clients of our system that use our checkout
        script can get their email regardless of the server setup.

        Look up Sender.pm with a search engine and you will see how it is used.

        regards

        Frank

        -----Original Message-----
        From: Mark Weston [mailto:mark@...]
        Sent: Monday, 11 December 2000 2:33 PM
        To: perl-beginner@egroups.com
        Subject: [PBML] Sendmail

        I recently moved to another host and have found out that they do not have
        sendmail on the server. Instead clients are required to use the smtp of
        their ISP's.
        I have a few cgi scripts which require the path to sendmail on the server.
        Is there a way to point to the smtp on my ISP in the cgi script?
        $mailprog = '/usr/sbin/sendmail'; How could I point to smtp1@...?
        Regards,
        Mark
        http://SiriusDog.com
        mark@...
      • Gordon Stewart
        Hi - I think I need sendmail it is available on my ISP - but ive tried the help / tutorials on the WWW - but i cant find any that help on sending email.
        Message 3 of 30 , Mar 20, 2001
        • 0 Attachment
          Hi - I think I need 'sendmail'

          it is available on my ISP - but ive tried the help / 'tutorials' on the WWW -
          but i cant find any that help on sending email.

          Ive got :-

          ============
          open(MAIL,">$tempfile\\tempfilecomplete") || die("Cannot open $tempfile --
          Check Directory Permissions : $!");

          print MAIL "To: gordonistewart_nz@...\n";
          print MAIL "From: Email list 1\n";
          print MAIL "Subject: Addition to email acddress!\n";
          print MAIL "$email has been added to our email list \n\n";
          close (MAIL);
          =============

          but What do i put at the top of the page (thats from an existing *VERY LONG*
          perl script - too hard to descipher

          I think the Tempfile thing is wrong - But ive found no 'short' example that i
          can use.

          Thanks.

          Gopher
        • Christian Gustavo Riva
          ... Change to this: print MAIL To: gordonistewart_nz @yahoo.co.uk n ; May be. Bye bye. Christian Gustavo Riva - FonoMax® 2000 - Control Telefonico -
          Message 4 of 30 , Mar 20, 2001
          • 0 Attachment
            > print MAIL "To: gordonistewart_nz@...\n";

            Change to this:

            print MAIL "To: gordonistewart_nz\@...\n";

            May be. Bye bye.

            Christian Gustavo Riva
            -> FonoMax® 2000 - Control Telefonico
            -> http://www.fonomax.com
            -> CGR Software - Programadores & Webmasters
            -> http://www.cgrsoftware.com
          • J.E. Cripps
            ... looks like you are treating the open as a file open, not a pipe, you so it is writing to a file, I d guess from the perldocs: How do I send mail? Use the
            Message 5 of 30 , Mar 20, 2001
            • 0 Attachment
              > it is available on my ISP - but ive tried the help / 'tutorials' on the WWW -
              > but i cant find any that help on sending email.


              looks like you are treating the open as a file open, not a pipe,
              you so it is writing to a file, I'd guess

              from the perldocs:

              How do I send mail?
              Use the sendmail program directly:

              open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")
              or die "Can't fork for sendmail: $!\n";
              print SENDMAIL <<"EOF";
              From: User Originating Mail <me\@host>
              To: Final Destination <you\@otherhost>
              Subject: A relevant subject line

              Body of the message goes here after the blank line
              in as many lines as you like.
              EOF
              close(SENDMAIL) or warn "sendmail didn't close nicely";

              The -oi option prevents sendmail from interpreting a line consisting
              of a single dot as "end of message". The -t option says to use the
              headers to decide who to send the message to, and B -odq says to put
              the message into the queue. This last option means your message won't
              be immediately delivered, so leave it out if you want immediate
              delivery.

              Or use the CPAN module Mail::Mailer:

              use Mail::Mailer;

              $mailer = Mail::Mailer->new();
              $mailer->open({ From => $from_address,
              To => $to_address,
              Subject => $subject,
              })
              or die "Can't open: $!\n";
              print $mailer $body;
              $mailer->close();

              The Mail::Internet module uses Net::SMTP which is less Unix-centric than
              Mail::Mailer, but less reliable. Avoid raw SMTP commands. There
              are many reasons to use a mail transport agent like sendmail. These
              include queueing, MX records, and security.
            • Gordon Stewart
              ... on the WWW - ... Hmm _ its 2 a.m. here - Im just going to bed but I tried what you suggested below - but the computer replied :- Software error: Can t
              Message 6 of 30 , Mar 20, 2001
              • 0 Attachment
                --- In perl-beginner@y..., "J.E. Cripps" <cycmn@n...> wrote:
                >
                > > it is available on my ISP - but ive tried the help / 'tutorials'
                on the WWW -
                > > but i cant find any that help on sending email.
                >
                >
                > looks like you are treating the open as a file open, not a pipe,
                > you so it is writing to a file, I'd guess
                >
                > from the perldocs:
                >
                > How do I send mail?
                > Use the sendmail program directly:

                Hmm _ its 2 a.m. here - Im just going to bed but I tried what you
                suggested below - but the computer replied :-

                "Software error:
                Can't find string terminator "EOF" anywhere before EOF at add1.cgi
                line 33.
                For help, please send mail to the webmaster (Your Webmaster), giving
                this error message and the time and date of the error. "

                I'll try tomorow night (unless youre still online..) ?

                gopher




                >
                > open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")
                > or die "Can't fork for sendmail: $!\n";
                > print SENDMAIL <<"EOF";
                > From: User Originating Mail <me\@host>
                > To: Final Destination <you\@otherhost>
                > Subject: A relevant subject line
                >
                > Body of the message goes here after the blank line
                > in as many lines as you like.
                > EOF
                > close(SENDMAIL) or warn "sendmail didn't close nicely";
                >
                > The -oi option prevents sendmail from interpreting a line consisting
                > of a single dot as "end of message". The -t option says to use the
                > headers to decide who to send the message to, and B -odq says to put
                > the message into the queue. This last option means your message
                won't
                > be immediately delivered, so leave it out if you want immediate
                > delivery.
                >
                > Or use the CPAN module Mail::Mailer:
                >
                > use Mail::Mailer;
                >
                > $mailer = Mail::Mailer->new();
                > $mailer->open({ From => $from_address,
                > To => $to_address,
                > Subject => $subject,
                > })
                > or die "Can't open: $!\n";
                > print $mailer $body;
                > $mailer->close();
                >
                > The Mail::Internet module uses Net::SMTP which is less Unix-centric
                than
                > Mail::Mailer, but less reliable. Avoid raw SMTP commands. There
                > are many reasons to use a mail transport agent like sendmail. These
                > include queueing, MX records, and security.
              • Gordon Stewart
                ... on the WWW - ... Hmm - My message hasnt appeared after 10 minutes.. its 2:20 a.m. here - I better go to bed now - but I tried your above suggestion & got
                Message 7 of 30 , Mar 20, 2001
                • 0 Attachment
                  --- In perl-beginner@y..., "J.E. Cripps" <cycmn@n...> wrote:
                  >
                  > > it is available on my ISP - but ive tried the help / 'tutorials'
                  on the WWW -
                  > > but i cant find any that help on sending email.
                  >
                  >
                  > looks like you are treating the open as a file open, not a pipe,
                  > you so it is writing to a file, I'd guess
                  >
                  > from the perldocs:
                  >
                  > How do I send mail?
                  > Use the sendmail program directly:
                  >
                  > open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")
                  > or die "Can't fork for sendmail: $!\n";
                  > print SENDMAIL <<"EOF";
                  > From: User Originating Mail <me\@host>
                  > To: Final Destination <you\@otherhost>
                  > Subject: A relevant subject line
                  >
                  > Body of the message goes here after the blank line
                  > in as many lines as you like.
                  > EOF
                  > close(SENDMAIL) or warn "sendmail didn't close nicely";
                  >

                  Hmm - My message hasnt appeared after 10 minutes..

                  its 2:20 a.m. here - I better go to bed now - but I tried your above
                  suggestion & got this error message :-

                  ========
                  Software error:
                  Can't find string terminator "EOF" anywhere before EOF at add1.cgi
                  line 33.
                  For help, please send mail to the webmaster (Your Webmaster), giving
                  this error message and the time and date of the error.
                  ========

                  I'll try tomorow - I know sendmail on Netfirms works - because i Did
                  it over 1 year ago - but ive lost all my old scripts..

                  Gopher
                • Gordon Stewart
                  Hi there, Re sendmail - 1. How/Where do you download it from ? 2. Do i need 1 file / system, Or multiple modules/packages for it to work ? My system at home
                  Message 8 of 30 , Aug 28, 2001
                  • 0 Attachment
                    Hi there,

                    Re sendmail -

                    1. How/Where do you download it from ?

                    2. Do i need 1 file / system, Or multiple modules/packages for it to work ?

                    My system at home doesnt have it installed..

                    G.
                  • Daniel Gardner
                    GS Hi there, GS Re sendmail - GS 1. How/Where do you download it from ? GS 2. Do i need 1 file / system, Or multiple modules/packages for it to work ? GS
                    Message 9 of 30 , Aug 29, 2001
                    • 0 Attachment
                      GS> Hi there,

                      GS> Re sendmail -

                      GS> 1. How/Where do you download it from ?

                      GS> 2. Do i need 1 file / system, Or multiple modules/packages for it to work ?

                      GS> My system at home doesnt have it installed..

                      i think sendmail.org have the open-source version, and sendmail.com
                      have a shrink-wrapped pay-for version.

                      but i don't think they do it for windows...

                      try and find a program called "blat" - google should help you out
                      there, which you should be able to use instead of sendmail on windows.

                      alternatively look into the Net::SMTP module and learn about the SMTP
                      protocol.

                      blat is a tiny program and a single exe. you should find it useful.

                      hth,
                      daniel
                    • gordonisnz@yahoo.co.nz
                      ... Hmm - COULD be useful.. Ive just tested it... it sends a file by email - NOT what i want (I just want to use email - sendmail).. But -
                      Message 10 of 30 , Aug 29, 2001
                      • 0 Attachment
                        --- In perl-beginner@y..., Daniel Gardner <perl@p...> wrote:

                        > blat is a tiny program and a single exe. you should find it useful.

                        Hmm - COULD be useful..
                        Ive just tested it...

                        it sends a file by email - NOT what i want (I just want to use email -
                        sendmail)..

                        But - <me thinking in 5 dimensions> - What i CAN do..
                        is tell Perl to open up a text-file, Print my message to it, Close
                        it - THEN use Blat - to send it.. - Could work... ?

                        Ok - Neva mind - Will think about it over the next few days..

                        I better get to bed - almost 2 a.m. here, & an adult-movie is comming
                        on tv.. - must be late...

                        Goodnight & thanks...

                        G.
                      • Adrian Stovall
                        you can do: open (BLAT, |blat - -to user@domain.ext -subject test ); print BLAT this is the message body. ; close (BLAT); no need to use a file there, just
                        Message 11 of 30 , Aug 29, 2001
                        • 0 Attachment
                          you can do:

                          open (BLAT,"|blat - -to user@... -subject test");
                          print BLAT "this is the message body.";
                          close (BLAT);

                          no need to use a file there, just replace "this is the message body." with a
                          variable containing the text of your message :) The close command on BLAT
                          sends blat the signal that there's no more input (like the "[ctrl]+Z" in the
                          help file).

                          HTH

                          >-----Original Message-----
                          >From: gordonisnz@... [mailto:gordonisnz@...]
                          >Sent: Wednesday, August 29, 2001 8:57 AM
                          >To: perl-beginner@yahoogroups.com
                          >Subject: Re: [PBML] Sendmail
                          >
                          >
                          >--- In perl-beginner@y..., Daniel Gardner <perl@p...> wrote:
                          >
                          >> blat is a tiny program and a single exe. you should find it useful.
                          >
                          >Hmm - COULD be useful..
                          >Ive just tested it...
                          >
                          >it sends a file by email - NOT what i want (I just want to use email -
                          > sendmail)..
                          >
                          >But - <me thinking in 5 dimensions> - What i CAN do..
                          >is tell Perl to open up a text-file, Print my message to it, Close
                          >it - THEN use Blat - to send it.. - Could work... ?
                          >
                          >Ok - Neva mind - Will think about it over the next few days..
                          >
                          >I better get to bed - almost 2 a.m. here, & an adult-movie is comming
                          >on tv.. - must be late...
                          >
                          >Goodnight & thanks...
                          >
                          >G.
                          >
                          >
                          >
                          >------------------------ Yahoo! Groups Sponsor
                          >---------------------~-->
                          >Secure your servers with 128-bit SSL encryption! Grab your
                          >copy of VeriSign's FREE Guide: "Securing Your Web Site for
                          >Business." Get it Now!
                          >http://us.click.yahoo.com/n7RbFC/zhwCAA/yigFAA/ndFolB/TM
                          >---------------------------------------------------------------
                          >------~->
                          >
                          >
                          >
                          >Your use of Yahoo! Groups is subject to
                          >http://docs.yahoo.com/info/terms/
                          >
                          >
                        • gordon stewart
                          ... Thanks - Hmm - What does the 1st - sign do ? (BLAT, |blat - -to user@domain.ext -subject - one for the to & subject - What does the blank one do - is
                          Message 12 of 30 , Aug 30, 2001
                          • 0 Attachment
                            --- Adrian Stovall <AdrianS@...> wrote: > you
                            can do:

                            > open (BLAT,"|blat - -to user@... -subject
                            > test");
                            > print BLAT "this is the message body.";
                            > close (BLAT);

                            Thanks - Hmm - What does the 1st '-' sign do ?

                            (BLAT,"|blat - -to user@... -subject - one for
                            the 'to' & 'subject' - What does the blank one do - is
                            it necessary ?)

                            I'll test it out...

                            PS - if i put "blat" in my PATH information, I dont
                            need to do anything else ?
                            Or do i need to do something at the top of the CGI
                            /perl to point it to BLAT ?

                            G.



                            =====
                            G. Stewart
                            New Zealand chat & Discussion group email
                            new_zealand-help@yahoogroups.com for details.

                            http://travel.yahoo.com.au - Yahoo! Travel
                            - Got Itchy feet? Get inspired!
                          • gordon stewart
                            ... can do: Nope - Ive created a new file, & tested your lines. Ive uploaded my script to http://groups.yahoo.com/group/perl-beginner/files/GordonStewart/Blat1
                            Message 13 of 30 , Aug 30, 2001
                            • 0 Attachment
                              --- Adrian Stovall <AdrianS@...> wrote: > you
                              can do:

                              Nope - Ive created a new file, & tested your lines.

                              Ive uploaded my script to

                              http://groups.yahoo.com/group/perl-beginner/files/GordonStewart/Blat1

                              It produces the following "help file" on screen - NOT
                              what i want - & it didnt email me...

                              ------------------
                              --------------------------------------------------------------------------------
                              An E-mail message is about to be sent by blat.exe:
                              Blat v1.8.2b: WinNT/95 console utility to mail a file
                              via SMTP by P.Mendes, M.Neal, G.Vollant, T. Charron
                              http://www.interlog.com/~tcharron/blat.html syntax:
                              Blat -t [optional switches (see below)] Blat -install
                              [[[]]] [-q] Blat -profile [-delete | ""] [profile1]
                              [profileN] [-q] Blat -h [-q] -install [ [ []]] : set's
                              SMTP server, sender, number of tries and port for
                              profile ( and may be replaced by '-'). : file with the
                              message body ('-' for console input, end with ^Z) -t :
                              recipient list (comma separated) -s : subject line -f
                              : overrides the default sender address (must be known
                              to server) -i : a 'From:' address, not necessarily
                              known to the SMTP server. -c : carbon copy recipient
                              list (comma separated) -b : blind carbon copy
                              recipient list (comma separated) -o : Organization
                              field -h : displays this help. -q : supresses *all*
                              output. -noh : prevent X-Mailer header from showing
                              homepage of blat -noh2 : prevent X-Mailer header
                              entirely -p : send with SMTP server, user and port
                              defined in . -server : Specify SMTP server to be used.
                              (optionally, addr:port) -port : port to be used on the
                              server, defaults to SMTP (25) -hostname : select the
                              hostname used to send the message -mime : MIME
                              Quoted-Printable Content-Transfer-Encoding. -uuencode
                              : Send (binary) file UUEncoded -base64 : Send (binary)
                              file using base64 (binary Mime) -try : how many time
                              blat should try to send. from '1' to 'INFINITE'
                              -attach : attach binary file to message (may be
                              repeated) -attacht : attach text file to message (may
                              be repeated) Note that if the '-i' option is used, is
                              included in 'Reply-to:' and 'Sender:' fields in the
                              header of the message.
                              ------------------

                              In my last message - Do i need to put anything at the
                              top to point to Blat ?
                              (I dont think so, otherwise i wont ghet the "help"
                              file - Its formatted correctly if i view-source)

                              Ps - I've uploaded my original BLAT script (works) -
                              that used the file..

                              http://groups.yahoo.com/group/perl-beginner/files/GordonStewart/Blat-orig

                              Gordon.


                              > open (BLAT,"|blat - -to user@... -subject
                              > test");
                              > print BLAT "this is the message body.";
                              > close (BLAT);
                              >
                              > no need to use a file there, just replace "this is
                              > the message body." with a
                              > variable containing the text of your message :) The
                              > close command on BLAT
                              > sends blat the signal that there's no more input
                              > (like the "[ctrl]+Z" in the
                              > help file).
                              >
                              > HTH
                              >
                              > >-----Original Message-----


                              =====
                              G. Stewart
                              New Zealand chat & Discussion group email
                              new_zealand-help@yahoogroups.com for details.
                            • Jenda Krynicky
                              To: perl-beginner@yahoogroups.com From: gordon stewart Date sent: Fri, 31 Aug 2001 01:11:47 +1200 (NZST)
                              Message 14 of 30 , Aug 30, 2001
                              • 0 Attachment
                                To: perl-beginner@yahoogroups.com
                                From: gordon stewart <gordonisnz@...>
                                Date sent: Fri, 31 Aug 2001 01:11:47 +1200 (NZST)
                                Send reply to: perl-beginner@yahoogroups.com
                                Subject: RE: [PBML] Sendmail

                                > --- Adrian Stovall <AdrianS@...> wrote: > you
                                > can do:
                                >
                                > > open (BLAT,"|blat - -to user@... -subject
                                > > test");
                                > > print BLAT "this is the message body.";
                                > > close (BLAT);
                                >
                                > Thanks - Hmm - What does the 1st '-' sign do ?


                                Well I don't have Blat here, but usualy this means that the program
                                should read the data to process (to mail in this case) will from its
                                STDIN. (The data will be "piped" to the program.)

                                Try this on command prompt:

                                c:\> perl - foo bar baz

                                and press ENTER. You will see a blinking cursor at the beginning
                                of the next line.

                                If you then write

                                foreach (@ARGV) {
                                print "Param: $_\n";
                                }
                                ^Z
                                (The ^Z means that you press CTRL+Z and then ENTER)
                                you will get

                                Param: foo
                                Param: bar
                                Param: baz
                                c:\>

                                Here you tell PERL that the SCRIPT will be sent to its STDIN.

                                Jenda


                                == Jenda@... == http://Jenda.Krynicky.cz ==
                                : What do people think?
                                What, do people think? :-)
                                -- Larry Wall in <199808071736.KAA12738@...>
                              • gordonisnz@yahoo.co.nz
                                ... wrote: Ps - Ive changed it a bit, open (BLAT, |blat -hostname gordon52 @slingshot.co.nz -noh -server smtp.slingshot.co.nz -f gordon52 @slingshot.co.nz -p
                                Message 15 of 30 , Aug 30, 2001
                                • 0 Attachment
                                  --- In perl-beginner@y..., gordon stewart <gordonisnz@y...>
                                  wrote:

                                  Ps - Ive changed it a bit,

                                  open (BLAT,"|blat -hostname gordon52\@... -noh -server
                                  smtp.slingshot.co.nz -f gordon52\@... -p gordon52 -t
                                  gordonisnz\@... -s testing fire");
                                  print BLAT "this is the message body.";
                                  print BLAT "Hello there";
                                  close (BLAT);


                                  and now it says :-
                                  "Failed to open registry key for Blat profile gordon52, using
                                  default. Blat v1.8.2b: WinNT/95 console utility to mail a file via
                                  SMTP by P.Mendes, M.Neal, G.Vollant, T. Charron"
                                  (& the rest of the usual help file)
                                • Adrian Stovall
                                  have you run blat -install yet, like it says to do in the documentation? copy blat to winnt/system32 (or someplace else in your path, then type: blat
                                  Message 16 of 30 , Aug 30, 2001
                                  • 0 Attachment
                                    have you run "blat -install" yet, like it says to do in the documentation?

                                    copy blat to winnt/system32 (or someplace else in your path, then type:
                                    "blat -install mail.myserver.org me@..."

                                    this installs blat and creates the needed registry key.

                                    the "-" in place of a filename (as Jenda suggested) tells blat to take it's
                                    input from STDIN. There's a lot of info in the help screen that blat
                                    displays (I know 'cause I ignored most of it for a long time, I was
                                    surprised at how handy the info was when I finally looked at it).

                                    HTH

                                    Adrian

                                    >-----Original Message-----
                                    >From: gordonisnz@... [mailto:gordonisnz@...]
                                    >Sent: Thursday, August 30, 2001 9:07 AM
                                    >To: perl-beginner@yahoogroups.com
                                    >Subject: Re: [PBML] Sendmail Part 2
                                    >
                                    >
                                    >--- In perl-beginner@y..., gordon stewart <gordonisnz@y...>
                                    > wrote:
                                    >
                                    >Ps - Ive changed it a bit,
                                    >
                                    >open (BLAT,"|blat -hostname gordon52\@... -noh -server
                                    >smtp.slingshot.co.nz -f gordon52\@... -p gordon52 -t
                                    >gordonisnz\@... -s testing fire");
                                    >print BLAT "this is the message body.";
                                    >print BLAT "Hello there";
                                    >close (BLAT);
                                    >
                                    >
                                    >and now it says :-
                                    >"Failed to open registry key for Blat profile gordon52, using
                                    >default. Blat v1.8.2b: WinNT/95 console utility to mail a file via
                                    >SMTP by P.Mendes, M.Neal, G.Vollant, T. Charron"
                                    > (& the rest of the usual help file)
                                    >
                                    >
                                    >
                                    >
                                    >------------------------ Yahoo! Groups Sponsor
                                    >---------------------~-->
                                    >Secure your servers with 128-bit SSL encryption! Grab your
                                    >copy of VeriSign's FREE Guide: "Securing Your Web Site for
                                    >Business." Get it Now!
                                    >http://us.click.yahoo.com/n7RbFC/zhwCAA/yigFAA/ndFolB/TM
                                    >---------------------------------------------------------------
                                    >------~->
                                    >
                                    >
                                    >
                                    >Your use of Yahoo! Groups is subject to
                                    >http://docs.yahoo.com/info/terms/
                                    >
                                    >
                                  • Adrian Stovall
                                    Also, if you re going to use multi-word subjects, you should enclose them in PERL-escaped double quotes ( -s testing fire ). ...
                                    Message 17 of 30 , Aug 30, 2001
                                    • 0 Attachment
                                      Also, if you're going to use multi-word subjects, you should enclose them in
                                      PERL-escaped double quotes ( -s \"testing fire\" ).

                                      >-----Original Message-----
                                      >From: gordonisnz@... [mailto:gordonisnz@...]
                                      >Sent: Thursday, August 30, 2001 9:07 AM
                                      >To: perl-beginner@yahoogroups.com
                                      >Subject: Re: [PBML] Sendmail Part 2
                                      >
                                      >
                                      >--- In perl-beginner@y..., gordon stewart <gordonisnz@y...>
                                      > wrote:
                                      >
                                      >Ps - Ive changed it a bit,
                                      >
                                      >open (BLAT,"|blat -hostname gordon52\@... -noh -server
                                      >smtp.slingshot.co.nz -f gordon52\@... -p gordon52 -t
                                      >gordonisnz\@... -s testing fire");
                                      >print BLAT "this is the message body.";
                                      >print BLAT "Hello there";
                                      >close (BLAT);
                                      >
                                      >
                                      >and now it says :-
                                      >"Failed to open registry key for Blat profile gordon52, using
                                      >default. Blat v1.8.2b: WinNT/95 console utility to mail a file via
                                      >SMTP by P.Mendes, M.Neal, G.Vollant, T. Charron"
                                      > (& the rest of the usual help file)
                                      >
                                      >
                                      >
                                      >
                                      >------------------------ Yahoo! Groups Sponsor
                                      >---------------------~-->
                                      >Secure your servers with 128-bit SSL encryption! Grab your
                                      >copy of VeriSign's FREE Guide: "Securing Your Web Site for
                                      >Business." Get it Now!
                                      >http://us.click.yahoo.com/n7RbFC/zhwCAA/yigFAA/ndFolB/TM
                                      >---------------------------------------------------------------
                                      >------~->
                                      >
                                      >
                                      >
                                      >Your use of Yahoo! Groups is subject to
                                      http://docs.yahoo.com/info/terms/
                                    • Gordon Stewart
                                      ... Also, if you re going to use multi-word subjects, you should enclose them in PERL-escaped double quotes ( -s testing fire ).
                                      Message 18 of 30 , Aug 30, 2001
                                      • 0 Attachment
                                        >>> AdrianS@... 08/31/01 04:05 >>>
                                        Also, if you're going to use multi-word subjects, you should enclose them in
                                        PERL-escaped double quotes ( -s \"testing fire\" ).

                                        <

                                        LOL - ok :-)

                                        Any quick way in 'perl' to find the smtp server name ?
                                        its NOT smtp

                                        without asking someone that is - Theyre in a different city - the people that know :-)

                                        G.
                                      • Evan Dembskey
                                        Hi, How do I use UNiXs mail from within a perl script? All I want to be able to do is format a text file and mail it out. Regards, Jim
                                        Message 19 of 30 , Feb 11 6:04 AM
                                        • 0 Attachment
                                          Hi,


                                          How do I use UNiXs mail from within a perl script? All I want to be able to
                                          do is format a text file and mail it out.


                                          Regards,

                                          Jim
                                        • sgharms@obsidiansunrise.net
                                          Evan Dembskey writes: You can either use system ( cat foo |mail monkey@hobo.com ); which will look very UNIX-y. Or you could be very
                                          Message 20 of 30 , Feb 11 6:27 AM
                                          • 0 Attachment
                                            "Evan Dembskey" <evan@...> writes:

                                            You can either use

                                            system ("cat foo |mail monkey@...");

                                            which will look very UNIX-y.

                                            Or you could be very Perl-y and look into using the
                                            perl module for sendmail (look it up at http://search.cpan.org).

                                            sgh

                                            > Hi,
                                            >
                                            >
                                            > How do I use UNiXs mail from within a perl script? All I want to be able to
                                            > do is format a text file and mail it out.
                                            >
                                            >
                                            > Regards,
                                            >
                                            > Jim
                                            >
                                            >
                                            >
                                            > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
                                            >
                                            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                                            >
                                            >
                                            >

                                            --
                                            http://www.obsidiansunrise.net
                                          • BMW_Bloke
                                            ... able to ... ================================================================ Do you want to send the text file as body text or as an attachment? I ve got
                                            Message 21 of 30 , Feb 11 8:15 AM
                                            • 0 Attachment
                                              --- In perl-beginner@y..., "Evan Dembskey" <evan@t...> wrote:
                                              > Hi,
                                              >
                                              >
                                              > How do I use UNiXs mail from within a perl script? All I want to be
                                              able to
                                              > do is format a text file and mail it out.
                                              ================================================================
                                              Do you want to send the text file as body text or as an attachment?

                                              I've got routines for both, neither of which require use of any
                                              modules.

                                              Greg
                                              www.uksites4all.co.uk
                                            • Peter L. Berghold
                                              ... Hash: SHA1 Content-Type: text/plain; charset=us-ascii - From the MIME::Lite man page: Create a single-part message: ### Create a new single-part message,
                                              Message 22 of 30 , Feb 11 9:28 AM
                                              • 0 Attachment
                                                -----BEGIN PGP SIGNED MESSAGE-----
                                                Hash: SHA1

                                                Content-Type: text/plain; charset=us-ascii


                                                - From the MIME::Lite man page:


                                                Create a single-part message:

                                                ### Create a new single-part message, to send a GIF file:
                                                $msg = MIME::Lite->new(
                                                From =>'me@...',
                                                To =>'you@...',
                                                Cc =>'some@..., some@...',
                                                Subject =>'Helloooooo, nurse!',
                                                Type =>'image/gif',
                                                Encoding =>'base64',
                                                Path =>'hellonurse.gif'
                                                );

                                                Create a multipart message (i.e., one with attachments):

                                                ### Create a new multipart message:
                                                $msg = MIME::Lite->new(
                                                From =>'me@...',
                                                To =>'you@...',
                                                Cc =>'some@..., some@...',
                                                Subject =>'A message with 2 parts...',
                                                Type =>'multipart/mixed'
                                                );

                                                - --
                                                ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                                                Peter L. Berghold Peter@... -or- Peter.Berghold@...
                                                Manager Unix Engineering,MT Sinai NYU (212) 263-6932
                                                For PGP public key send email to: pgp-key@...


                                                -----BEGIN PGP SIGNATURE-----
                                                Version: GnuPG v1.0.6 (GNU/Linux)
                                                Comment: Exmh version 2.2 06/23/2000

                                                iD8DBQE8Z/83UM9/01RIhaARAiK0AKDAwHWmdEFjIUzR1xleOkoUNxorEwCeNwR1
                                                Q0yba3ElI/68ILyXeH7ddVo=
                                                =Ts/e
                                                -----END PGP SIGNATURE-----
                                              • pltommyo
                                                open FH, |elm -s $subject $mailList ; print FH $message; print FH [include $fileToInclue text/plain ] ; close FH; Tommy O
                                                Message 23 of 30 , Feb 11 9:53 AM
                                                • 0 Attachment
                                                  open FH, "|elm -s \"$subject\" $mailList";
                                                  print FH $message;
                                                  print FH "\[include $fileToInclue text/plain\]";
                                                  close FH;


                                                  Tommy O



                                                  --- In perl-beginner@y..., "Evan Dembskey" <evan@t...> wrote:
                                                  > Hi,
                                                  >
                                                  >
                                                  > How do I use UNiXs mail from within a perl script? All I want to be able to
                                                  > do is format a text file and mail it out.
                                                  >
                                                  >
                                                  > Regards,
                                                  >
                                                  > Jim
                                                • pltommyo
                                                  For error trapping (always a good idea) you should use: open FH, |elm -s $subject $mailList 1 /dev/null 2 &1 ; Tommy O
                                                  Message 24 of 30 , Feb 11 9:55 AM
                                                  • 0 Attachment
                                                    For error trapping (always a good idea) you should use:

                                                    open FH, "|elm -s \"$subject\" $mailList 1>/dev/null 2>&1";

                                                    Tommy O



                                                    --- In perl-beginner@y..., "pltommyo" <obrientora@a...> wrote:
                                                    > open FH, "|elm -s \"$subject\" $mailList";
                                                    > print FH $message;
                                                    > print FH "\[include $fileToInclue text/plain\]";
                                                    > close FH;
                                                    >
                                                    >
                                                    > Tommy O
                                                    >
                                                    >
                                                    >
                                                    > --- In perl-beginner@y..., "Evan Dembskey" <evan@t...> wrote:
                                                    > > Hi,
                                                    > >
                                                    > >
                                                    > > How do I use UNiXs mail from within a perl script? All I want to be able to
                                                    > > do is format a text file and mail it out.
                                                    > >
                                                    > >
                                                    > > Regards,
                                                    > >
                                                    > > Jim
                                                  • BMW_Bloke
                                                    This is how I do it without using modules: $email = name @domain ; # recipients e-mail address. $from = John Doe ; #senders e-mail
                                                    Message 25 of 30 , Feb 12 3:46 AM
                                                    • 0 Attachment
                                                      This is how I do it without using modules:

                                                      $email = "name\@domain"; # recipients e-mail address.
                                                      $from = "\"John Doe\" <johndoe\@mydomain>"; #senders e-mail address
                                                      $file = "report.txt"; # Name of file to be attached/included.
                                                      $path = "/home/domain/path/to/$file"; # Path to attachment
                                                      $mailprog = "/usr/lib/sendmail"; # path to sendmail

                                                      #--- Open & Read the file to be attached ---#
                                                      open(OUTF,"$path");
                                                      @report = <OUTF>;
                                                      close (OUTF);

                                                      #-- Send message with attachment --#
                                                      open(MAIL,"|$mailprog -t");
                                                      print MAIL "To: $email\n";
                                                      print MAIL "From: $from\n";
                                                      print MAIL "Subject: Some subject line\n";
                                                      print MAIL "MIME-Version: 1.0\n";
                                                      print MAIL "Content-type: multipart/mixed;
                                                      boundary=\"someboundarycharacters\"\n\n";
                                                      print MAIL "--someboundarycharacters\n";
                                                      print MAIL "Content-type: text/plain; charset=us-ascii\n\n";
                                                      print MAIL "Message text goes here.\n\n"; # Must end with 2 linefeeds
                                                      print MAIL "--someboundarycharacters\n";
                                                      print MAIL "Content-type: application/octet-stream;
                                                      name=\"$file\"\n\n";
                                                      print MAIL "@report\n\n"; # Add the attachment
                                                      print MAIL "--bmwclubboundary--\n\n";
                                                      close (MAIL);

                                                      NOTE: The number of newline (\n) characters after each section is
                                                      very important.

                                                      To include the text file in the body of the message, instead of as an
                                                      attachment, leave out all the MIME, Content-type and boundary stuff.

                                                      I have tested this with Eudora and Outlook, and it works.

                                                      Greg Smith
                                                      uksites4all.co.uk
                                                      bmwclub.org.uk
                                                    • BMW_Bloke
                                                      ... ========================================================== Oooops! This line should read: print MAIL --someboundarycharacters-- n n ; Sorry!
                                                      Message 26 of 30 , Feb 12 4:43 AM
                                                      • 0 Attachment
                                                        --- In perl-beginner@y..., "BMW_Bloke" <webmaster@b...> wrote:
                                                        > This is how I do it without using modules:

                                                        > print MAIL "--bmwclubboundary--\n\n";
                                                        ==========================================================
                                                        Oooops!

                                                        This line should read:
                                                        print MAIL "--someboundarycharacters--\n\n";

                                                        Sorry!
                                                        ===========================================================
                                                        Greg
                                                      • picsian1 <imoq172@hotmail.com>
                                                        Hello all I m using sendmail and I ve got it coded like this: open(MAIL, |/usr/sbin/sendmail -oi -t ) || Error ( open , mail program ); select (MAIL);
                                                        Message 27 of 30 , Feb 1 6:37 PM
                                                        • 0 Attachment
                                                          Hello all
                                                          I'm using sendmail and I've got it coded like this:


                                                          open(MAIL, "|/usr/sbin/sendmail -oi -t ") || Error ('open', 'mail
                                                          program');
                                                          select (MAIL);
                                                          print << "EOF";
                                                          To: $postInputs{'Email'}
                                                          From: $Contact
                                                          Subject: Testing

                                                          $time
                                                          First Name: $postInputs{'First'}
                                                          Last Name: $postInputs{'Last'}
                                                          Address: $postInputs{'Address'}

                                                          EOF

                                                          close(MAIL);
                                                          select (STDOUT);



                                                          Pretty standard. The $Contact in the From: is a string like so:
                                                          $Contact=$postInputs{'First'} . ' ' . $postInputs{'Last'} ;

                                                          When I get the email, the From address shows up as :

                                                          Howard.Hunt@...

                                                          Howard.Hunt is coming from the $Contact, but where is the
                                                          @... coming from? I'd like to change it to my
                                                          domain. How would I do that?

                                                          Your help is greatly appreciated.

                                                          Gary
                                                        • Charles K. Clarkson
                                                          ... The @megawebservers.com might be coming from sendmail because someone has turned on the always_add_domain feature:
                                                          Message 28 of 30 , Feb 1 9:45 PM
                                                          • 0 Attachment
                                                            picsian1 <imoq172@...> wrote:

                                                            : When I get the email, the From address shows up as :
                                                            :
                                                            : Howard.Hunt@...
                                                            :
                                                            : Howard.Hunt is coming from the $Contact, but where
                                                            : is the @... coming from? I'd like
                                                            : to change it to my domain. How would I do that?

                                                            The "@..." might be coming from
                                                            sendmail because someone has turned on the
                                                            "always_add_domain" feature:
                                                            http://www.tek-tips.com/gviewthread.cfm/lev2/3/lev3/15/pid/14/qid/436479

                                                            Have you tried to send the email with the domain
                                                            you want added on to $Contact? Your example seems to
                                                            indicate that you are not sending the domain name in
                                                            $Contact, but you don't actually say that.

                                                            $Contact .= '@...'


                                                            This is a sendmail issue, not a perl programming
                                                            issue. Have you tried USENET: news:comp.mail.sendmail?
                                                            Search at groups.google before asking your question.


                                                            HTH,

                                                            Charles K. Clarkson
                                                            --
                                                            Head Bottle Washer,
                                                            Clarkson Energy Homes, Inc.
                                                            Mobile Home Specialists
                                                            254 968-8328
                                                          • picsian1 <imoq172@hotmail.com>
                                                            Charles, Thank you for responding. You re dead-on!. You must include the domain at the end. Thanks again. gary ...
                                                            Message 29 of 30 , Feb 2 10:30 AM
                                                            • 0 Attachment
                                                              Charles,
                                                              Thank you for responding. You're dead-on!. You must include the
                                                              domain at the end.
                                                              Thanks again.
                                                              gary

                                                              --- In perl-beginner@yahoogroups.com, "Charles K. Clarkson"
                                                              <cclarkson@h...> wrote:
                                                              > picsian1 <imoq172@h...> wrote:
                                                              >
                                                              > : When I get the email, the From address shows up as :
                                                              > :
                                                              > : Howard.Hunt@m...
                                                              > :
                                                              > : Howard.Hunt is coming from the $Contact, but where
                                                              > : is the @... coming from? I'd like
                                                              > : to change it to my domain. How would I do that?
                                                              >
                                                              > The "@..." might be coming from
                                                              > sendmail because someone has turned on the
                                                              > "always_add_domain" feature:
                                                              > http://www.tek-
                                                              tips.com/gviewthread.cfm/lev2/3/lev3/15/pid/14/qid/436479
                                                              >
                                                              > Have you tried to send the email with the domain
                                                              > you want added on to $Contact? Your example seems to
                                                              > indicate that you are not sending the domain name in
                                                              > $Contact, but you don't actually say that.
                                                              >
                                                              > $Contact .= '@...'
                                                              >
                                                              >
                                                              > This is a sendmail issue, not a perl programming
                                                              > issue. Have you tried USENET: news:comp.mail.sendmail?
                                                              > Search at groups.google before asking your question.
                                                              >
                                                              >
                                                              > HTH,
                                                              >
                                                              > Charles K. Clarkson
                                                              > --
                                                              > Head Bottle Washer,
                                                              > Clarkson Energy Homes, Inc.
                                                              > Mobile Home Specialists
                                                              > 254 968-8328
                                                            • Jack Swayze
                                                              I have the MOD Mail::Mailer installed. I am trying to get some information sent to my from a perl script. I get everything except the body. ANy help would
                                                              Message 30 of 30 , Jun 9, 2003
                                                              • 0 Attachment
                                                                I have the MOD Mail::Mailer installed. I am trying to get some
                                                                information sent to my from a perl script. I get everything except the
                                                                body. ANy help would ROCK. I am going in circles. I can send it from the
                                                                command line NP.

                                                                #opt1 SUBROUTINE
                                                                sub opt1
                                                                {
                                                                print "$clear";
                                                                print "what is your name?\n";
                                                                $name=<>;
                                                                chop($name);

                                                                print "What is your email address?\n";
                                                                $email=<>;
                                                                chop($email);

                                                                print "What is the problem. Please give as much information as possible.
                                                                Please include error messages, and what you were doing at the time.\n";
                                                                $problem=<>;


                                                                print "What priority is this (examples...HIGH MEDIUM LOW)\n";
                                                                $priority=<>;
                                                                chop($priority);


                                                                use Mail::Mailer;
                                                                $junior='jswayze@...';
                                                                $mailer = Mail::Mailer->new("sendmail");
                                                                $mailer->open({ From =>$email,
                                                                To =>$junior,
                                                                Subject =>$priority,
                                                                Body =>$problem,
                                                                })
                                                                }
                                                              Your message has been successfully submitted and would be delivered to recipients shortly.