Facebook   Twitter    e-mail newsletter    YouTube    RSS Feed    Android App    iPhone and iPad App     BlackBerry App    


Results 1 to 8 of 8

Thread: MWEB Hosting, PHP Mail function, Help please

  1. #1
    Grandmaster
    Join Date
    Jan 2005
    Location
    Jo†⊃u☞g
    Posts
    4,150

    Default MWEB Hosting, PHP Mail function, Help please

    One of my clients hosts with Mweb and the php mail function seems to be all but dead. Anyone else here host with them that can tell me what MWEB expects from the mail function. Even this basic code fails:

    Code:
    <?php
    
    if (mail("gregory@mydomain.com", "Test message", "This is the message", "From: another@domain.com
    ")) {echo "Success!";} else {echo "Failed";}
    
    ?>
    ★ mAcme for Mac OS X & 3G modems
    MY BLOED IS BLOU!
    Visit my friends

  2. #2
    Super Grandmaster
    Join Date
    Jun 2009
    Location
    255.255.255.255
    Posts
    6,368

    Default

    Hmm, that's weird.....

    Email support (or rather phone) and ask them to take a look at it.
    It should be working fine, as I use it on a client's site (hosted at Mweb) and it works fine.
    Running Windows? ... Upgrade to Linux

  3. #3

    Default

    Quote Originally Posted by GreGorGy View Post
    One of my clients hosts with Mweb and the php mail function seems to be all but dead. Anyone else here host with them that can tell me what MWEB expects from the mail function. Even this basic code fails:

    Code:
    <?php
    
    if (mail("gregory@mydomain.com", "Test message", "This is the message", "From: another@domain.com
    ")) {echo "Success!";} else {echo "Failed";}
    
    ?>
    Post your form code here and I will write you a mail handler

  4. #4
    Super Grandmaster
    Join Date
    Aug 2004
    Location
    United Kingdom
    Posts
    8,584

    Default

    I don't host with MWEB, but I would like to point something out:

    Code:
    mail("gregory@mydomain.com", "Test message", "This is the message", "From: another@domain.com
    ")
    The From field part of the DATA portion of the mail. It is ignored by the mail server. The mail server cares about the envelope sender, and you're not setting the envelope sender, so your mail is going to come from something like apache@web12.mweb.com or whatever they call their boxes. Check the headers for the "Return-path" header

    You need to do something like:

    Code:
    mail("gregory@mydomain.com", "Test message", "This is the message", "From: another@domain.com
    ", "-fsender@domain.com")
    The -f is passed to the sendmail binary and sets the envelope sender.
    Last edited by koffiejunkie; 30-01-2012 at 04:19 PM.

  5. #5
    Grandmaster
    Join Date
    Jan 2005
    Location
    Jo†⊃u☞g
    Posts
    4,150

    Default

    Quote Originally Posted by koffiejunkie View Post
    Code:
    mail("gregory@mydomain.com", "Test message", "This is the message", "From: another@domain.com
    ", "-fsender@domain.com)
    The -f is passed to the sendmail binary and sets the envelope sender.


    Hey - you wanna make me spend even more time on this? Because the code above will of course bail

    Missing " at end....

    Ja, I am aware. I wanted to reduce this mail function to the very bare basics. The code above is stored as testmail.php on the route of their website and has nothing else. It fails to send mail. At the very least, all other semantics aside, it should try to send something.

    Byron: with all due respect, I have had the form working for a long time - it has recently started misbehaving. It is not the code but the server. They have just told me now (on the phone) that I need to explicitly set the sendmail path. I can write my own handlers quite beautifully thanks
    ★ mAcme for Mac OS X & 3G modems
    MY BLOED IS BLOU!
    Visit my friends

  6. #6
    Super Grandmaster
    Join Date
    Aug 2004
    Location
    United Kingdom
    Posts
    8,584

    Default

    Quote Originally Posted by GreGorGy View Post
    Hey - you wanna make me spend even more time on this? Because the code above will of course bail
    Missing " at end....

    Oops my bad! Fixed now.

  7. #7

    Default

    Does MWeb uncapped hosting (the R19 per month) thing have support for PHP5 and MySQL database? How much space for databases do you get?

  8. #8
    Super Grandmaster
    Join Date
    Jun 2009
    Location
    255.255.255.255
    Posts
    6,368

    Default

    Quote Originally Posted by ngadao08 View Post
    Does MWeb uncapped hosting (the R19 per month) thing have support for PHP5 and MySQL database? How much space for databases do you get?
    Yes, and 50MB (1 database).
    Running Windows? ... Upgrade to Linux

Bookmarks

Bookmarks

Posting Permissions

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