Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    SHY
    SHY is offline
    New Coder
    Join Date
    Apr 2005
    Location
    Kosice, Slovakia
    Posts
    36
    Thanks
    2
    Thanked 0 Times in 0 Posts

    php and its mail() function

    greetings,

    i have a following problem with the usage of the php's mail() function on one particular server.
    the reason of the problem is that the leadership of the server has deactivated this function for "security reasons" and apparently they dont have any other way to send e-mails thru php interface (like SMTP or sendmail) or they just dont even know about it.
    there's only one "reasonable" solution in this situation (apart from moving the whole webpage to another server, which is at this moment unacceptable) and that is to move the mailing script on another server and use some php interface to access the script without leaving the server where the webpage itself is run. the thing is that i cant make it done yet, cause i acctually dont have enough information about any specific interface that could be use in this situation. so im asking you, wise guys of the CodingForums, how could this be done? i was thinking of using Curl, but im not sure if this is a good one. if there is any other way to make it work (without substracting the mail script from the rest of the page totally), tell me. im sure there is a solution to this but i personally cant figure it out.

    and btw, i couldnt even look at the information from phpinfo() function cause that one is deactivated for security reasons as well.

    thank you very much in advance :-) i would be very grateful for any information in this case.

    SHY
    "Programming is an art form that fights back."

  • #2
    New Coder
    Join Date
    Jul 2005
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you can put your mail script in other server with active mail function, you can just redirect information from your server to pass info via post,get or session to your mail function in other server. After sending mail you can agian show result at your server.

    Success!!!
    If you can not find a decision, maybe you have to try to change a problem

    http://www.gunman.co.nr
    http://bglinux.org

  • #3
    New Coder
    Join Date
    Dec 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you're going to do that, please make sure you implement some kind of security into the mail script, otherwise you'll create an open relay mail server and that's very bad.

  • #4
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you just set it up as a POST receive script, cURL should work just fine in this manner, just make sure to POST a password as well to ensure your 'email solution' doesn't become an open, spammable mail relay as Prikid mentioned. The construction of the script should be pretty easy, it'd be just as if you were receiving a POST form submission, only it'd check for $_POST['r_pass'] too or something similar. That being said, you should make the POST field and the password its self odd and random.

    See the php.net page on cURL, it has plenty of examples.
    "$question = ( to() ) ? be() : ~be();"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •