SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: sendmail

  1. #1
    SitePoint Enthusiast omerie63's Avatar
    Join Date
    Jul 2004
    Location
    WISCONSIN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question sendmail

    I am having problems with sendmail in Fedora Core 2. My installation came with everything, so I did not have to play with anything, but it is not working.

    It looks like I can can send mail but it is ot going to the destination.

    PHP Code:
    <?php

    $success
    =mail("myaddress@host.com","My Subject","Line 1\n Line 2\n Line 3\n");

    if(
    $success){
       print(
    "Success!");
    }else{
       print(
    "Not Really!");
    }

    ?>

    and I see:


    Success!



    but I do not get any mail in myaddress@host.com

    I am not really familiar with sendmail that much so, help me on this one.

    I searched around for a few days, but haven't gotten far.

    Thanks in advance!
    So easy to use no wonder it's number one!

  2. #2
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may not have gotten mail because the sender's email address is missing. Change this:

    Code:
    $success=mail("myaddress@host.com","My Subject","Line 1\n Line 2\n Line 3\n");
    to this:

    Code:
    $success=mail("myaddress@host.com","My Subject","Line 1\n Line 2\n Line 3\n","sender@domain.com");
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  3. #3
    SitePoint Addict trogdor1024's Avatar
    Join Date
    Oct 2004
    Location
    New Jersey
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't you have to put the From: in there? Maybe not, but try this if that doesn't work...
    Code:
    $success=mail("myaddress@host.com","My Subject","Message Text","From: sender@domain.com");
    It still may be that SMTP is not configured correctly on your server, but certainly try this first, sendmail configuration sucks!

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    texas
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, it sounds like sendmail is configured wrong. it shouldn't matter whether or not you put in the "From" header in that last param or not (i think that only helps email clients not mark it as spam)...
    free online calendar: http://inversiondesigns.com
    includes multiple calendars/users/groups, task manager,
    email and sms reminders, permissions (sharing), etc.

  5. #5
    SitePoint Enthusiast omerie63's Avatar
    Join Date
    Jul 2004
    Location
    WISCONSIN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Guys thanks a lot for answering so fast, I am going to try it out!

    Erion
    So easy to use no wonder it's number one!

  6. #6
    SitePoint Enthusiast omerie63's Avatar
    Join Date
    Jul 2004
    Location
    WISCONSIN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sucks but it is true, It did not work!

    Well, I installed Fedora Core 2, and I sendmail is running as a process. I am not sure what to configure. The port and the hostname were set to 25 and localhost as by default and I did not see any other thing I needed to change. The instructions on setting it up are not really clear!
    So easy to use no wonder it's number one!

  7. #7
    SitePoint Member
    Join Date
    Jan 2005
    Location
    San Francisco
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From what I recall, PHP's mail function will return true on successfull execution, but does not check in any fashion to see if the mail was actually sent.

    Off-hand troubleshooting:

    - Load up your php_info page or php.ini and see if the path to sendmail is configured correctly, and that the "-t" flag is set.
    - See if you can send any mail through that server at all, outside of PHP. Try sending something using mail from the command line.

    You probably don't want to fool with sendmail configurations, which are quite complicated and difficult (I got scared off the thing a long time back). Try an alternative MTA like exim (http://www.exim.org/).

  8. #8
    SitePoint Enthusiast omerie63's Avatar
    Join Date
    Jul 2004
    Location
    WISCONSIN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It turns out that google is refusing it. I remember I read some where about \r\n

    Do you guys understand anything from this? What am I doing wrong!


    PHP Code:
    <?php

    $success
    =mail("erion_usa@yahoo.com","My Subject","Blah Blah""From: [email]erion@usa@yahoo.com[/email]\n");

    if(
    $success){
       print(
    "Success!");
    }else{
       print(
    "Not Really!");
    }

    ?>
    Last edited by omerie63; Jan 13, 2005 at 08:09.
    So easy to use no wonder it's number one!

  9. #9
    SitePoint Enthusiast omerie63's Avatar
    Join Date
    Jul 2004
    Location
    WISCONSIN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys,

    I just found out my problem. I was talking to some friends of mine and they imidiately after me showing them the email records, from the mail command, that if I did not have a domain registered, email that came out of my machine was be considered spam.
    I could see in there that the messages were sent but were denied by the destination.

    I learned something new, this time too!


    Thanks to those who helped!
    So easy to use no wonder it's number one!


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
  •