SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot ohnnyj's Avatar
    Join Date
    Jun 2003
    Location
    California
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sending Mail to Same Domain

    Hello all:

    For some reason I am having trouble sending e-mails to the same domain using the mail function. When I send to any domain other than the one hosting the site it works fine but will not with an address local to the machine.

    Any ideas?

    Thanks.

  2. #2
    SitePoint Zealot mrWoot's Avatar
    Join Date
    Jan 2004
    Location
    Wisconsin
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you paste your php code here so we can see what you've tried?

  3. #3
    SitePoint Zealot ohnnyj's Avatar
    Join Date
    Jun 2003
    Location
    California
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure:

    PHP Code:
    $to "name@mydomain.com";
    $from "name@mydomain.com";
    $lastname "Smith";
    $firstname "John";
    $subject "Test";
    $message "Test";
    $headers "From: " $firstname " " $lastneame "<" $from ">\n";
    $headers .= "Reply-To: " $firstname " " $lastname "<" $from ">\n";
    $headers .= "Content-Type: TEXT/plain; CHARSET=US-ASCII";
    $headers .= "X-Mailer: PHP/" phpversion() . "\n";
         
    if(@
    mail($to$subject$message$headers)) {
        echo 
    "Success";
    } else {
        echo 
    "Failure";


  4. #4
    SitePoint Evangelist
    Join Date
    Nov 2003
    Location
    England
    Posts
    540
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi ohnnyj - did you find the reason for this? i'm having a similar problem, but i've tracked mine down to being an open relay problem, which may be what you're experiencing as the first thing I noticed was that I couldn't send email to myself:

    http://www.sitepoint.com/forums/showthread.php?t=373917

    Not found a solution just yet.

    Matt.

  5. #5
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Use the PHPMailer() class and authenticate with the SMTP server? (Doesn't directly answer the question, but is probably the better workaround).
    Ian Anderson
    www.siteguru.co.uk

  6. #6
    SitePoint Evangelist
    Join Date
    Nov 2003
    Location
    England
    Posts
    540
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know about ohynnyj but thats what im just trying now, that way it should work just like an email client, so shouldn't be any problems!

  7. #7
    Always learning viveknarula's Avatar
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy

    hi, siteguru i hv same kind of problem in my code that is listed in this other thread that is here:-
    http://www.sitepoint.com/forums/showthread.php?t=373582

    plz help me to get it sorted

    Thanx

  8. #8
    SitePoint Evangelist
    Join Date
    Nov 2003
    Location
    England
    Posts
    540
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using PHPMailer now, slightly slower since its using SMTP but works a treat


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
  •