Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Php mailsend error ?

  • 07-11-2005 4:32pm
    #1
    Registered Users, Registered Users 2 Posts: 575 ✭✭✭


    Hi there

    I have set-up a php forum fine and all working grand .

    But when i reply to a thread i get a mailsend error

    I think the sendmail function might be disabled on the sever i'm hosting with .

    So i tried to set the smtp but the ones i tried dont seem to have open port 25 any more b/c of all the spam i guess .

    Does anyone know of any way else of sending reply mails in php ?

    I know might be asking alot

    Any help would be grerat Thanks

    Alan


Comments

  • Registered Users, Registered Users 2 Posts: 68,190 ✭✭✭✭seamus


    What's the actual error you're getting?

    If you set it to your host's smtp server, it should work fine.


  • Registered Users, Registered Users 2 Posts: 575 ✭✭✭Ozeire


    Error i get


    Failed sending email :: PHP ::

    DEBUG MODE

    Line : 234
    File : emailer.php



    :confused:


  • Registered Users, Registered Users 2 Posts: 304 ✭✭PhantomBeaker


    That looks like you're using phpBB that you're using.

    One of a number of things could be happening. Before we investigate the solution I need to ask, do you want to be able to send mail or not?

    Personally, the versions that I ran either ran off my home machine as a toy thing (so I wasn't keen on it trying to mail) or I didn't want it doing bad thing to the mail server of the machine hosting it.

    If you do want to mail, there's an option to select SMTP mailing... so find an SMTP server that will allow you to send from it (you may have to make special arrangments).

    My solution was to hack the bejaysus out of the emailer.php class in the includes dir. I should mention this was a dirty hack. I decided to butcher the send() function. There's a line a bit like
    [php]
    if ( $this->use_smtp )
    [/php]

    Go into the else statement. Did I mention this was a dirty hack?

    Anyway there are two lines that look roughly like
    [php]
    $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers);
    [/php]

    You want to comment out that line (I just shoved // in front of them) - did I mention it was a dirty hack?

    Looking back on the code (well commented, about how it was a dirty hack, and how it would still let SMTP work if you selected it) it looks like I also commented out
    [php]
    if (!$result)
    [/php]

    Problem is, I can't find any of the code that it'd relate to... and I'm the type who comments out the code they don't want rather than delete it, especially if it's likely I'll want it back some time.

    So yeah, that's my dirty hack of a solution. It won't fix your mail problem - it still won't send mail.. but at least it won't actually try, so it won't complain of errors. :P

    P.B.


Advertisement