Thread: Mail path wrong

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    10
    Rep Power
    0
    My hosting company is not helping.... they have the the wrong path set for sendmail in the php.ini file they will not give me access to the file to change it and they won't change it themself so I was hopeing somone might have a work around I could use in my scripts.

    the path is set to /usr/sbin/sendmail -t
    and it should be /usr/bin/sendmail -t

    Thanks....
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>I was hopeing somone might have a work around
    1) Switch webhost
    2) Use Perl
    3) Have your PHP to call up a Perl script just to send mail (note: your Perl script probably needs to accept GET method so you can pass some variables to it with 'query string'
    #############################################
    <? include("http://www.foobar.com/cgi-bin/yourscript.pl?subject=Your+Subject+here&name=first_name+last_name&email=the@email.here"); ?>

    Here is an example of your Perl script just to do the sendmail..

    #!/usr/local/bin/perl
    $your_email = 'your@email.com';
    $your_name = "David Span";

    @pairs = split(/&/, $ENV{'QUERY_STRING'});
    foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $FORM{$name} = $value;
    }
    print "Content-type: text/htmlnn";
    open (SENDMAIL, "| /usr/bin/sendmail -t") | | die &error("Unable to open sendmail");
    print SENDMAIL "Subject: $FORM{'subject'}n";
    print SENDMAIL "From: $your_name <$your_email>n";
    print SENDMAIL "To: $FORM{'name'} <$FORM{'email'}>nn";
    print SENDMAIL "Hello $FORM{'name'}n";
    print SENDMAIL "Your Message Heren";
    close (SENDMAIL);
    print "Mail Sent!n";

    sub error {
    $error = $_[0];
    print "$errorn";
    exit(0);
    }



    [This message has been edited by freebsd (edited July 02, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    5
    Rep Power
    0
    Hi

    I had the same problem with my ISP so I did send in a support ticket where I quoted the discussion on http://www.devshed.com/Talk/Forums/F...ML/001651.html

    This managed them to change the path, however it didn't help on my mail function. It still doesn't work. My ISP claims that not all php functions works on their servers, even though I managed to use the mail function before. I'm hosting with another ISP as well so I made a script using the mail function there, however I having problems in returning a resonse on the original site in a thanks.htm. But I think is is my lack of understand of global variables, which I will have to investigate.

    Henrik Blicher

Similar Threads

  1. Replies: 4
    Last Post: May 13th, 2009, 07:03 AM
  2. Help with script
    By akastarlight in forum Perl Programming
    Replies: 1
    Last Post: February 6th, 2004, 06:55 AM
  3. mail() not working with ISP's mail server
    By wjones8050 in forum PHP Development
    Replies: 2
    Last Post: January 9th, 2004, 02:47 PM
  4. PHP mail problems
    By Morrigan in forum PHP Development
    Replies: 2
    Last Post: December 17th, 2003, 01:23 PM
  5. mail return path
    By adiwillow in forum PHP Development
    Replies: 3
    Last Post: December 12th, 2003, 09:22 AM

IMN logo majestic logo threadwatch logo seochat tools logo