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 10 of 10
  1. #1
    Regular Coder
    Join Date
    Nov 2003
    Location
    Code Heaven
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mail() function not working...

    mail("$mailto", "the subject", $message,"Wrom: CUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJV

    The error I get is:
    Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing.

    Why is this...? And what should I do??

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    mail("$mailto", "the subject", $message,"From: Email name <email@address.com>");

  • #3
    Regular Coder
    Join Date
    Nov 2003
    Location
    Code Heaven
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can't is use a variable in the Wrom: IPBARHDMNNSKVF
    "From:$myemail"
    Also is it completely necessary to enclose vars in double quotes("..."),coz they anyway get expanded,can't I just use:
    mail($mailto,$subject,"From:$myemail");
    ?

    Thx.

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    No, don't need to use double quotes and you can use variables. I was just pointing out what was wrong

  • #5
    Regular Coder
    Join Date
    Nov 2003
    Location
    Code Heaven
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes,I see...but the probem persists...I still get the same error message,should I look at php.ini for a possible solution...?

  • #6
    New Coder
    Join Date
    Jan 2004
    Location
    UK
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    have you edited the pp.ini file and changed the SMTP settings ?

    open php.ini with notepad .. search for SMTP

    set your hostname ( usually mail.yourdomain.com )
    & email address

    & if you are using linux / uinx etc etc you must define the path
    to your sendmail daemon

    im using a windows based ( local ) webserver but my email is handled via a linux box so i have the following

    [mail function]
    ; For Win32 only.
    SMTP = mail.mydomain.com
    ; For Win32 only.
    sendmail_from = chris@mydomain.com
    ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i').
    ;sendmail_path = /etc/local/sendmail

    hope that helps

  • #7
    Regular Coder
    Join Date
    Nov 2003
    Location
    Code Heaven
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks,it does,but can't I leave the sendmail_from commented out and specify it in the mail()'s "From:" argument...??

  • #8
    New Coder
    Join Date
    Jan 2004
    Location
    UK
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i think so .. give it a try .. havent tried it myself.

    as long as you specify $from in your script it should work but no promising


    good luck

  • #9
    Regular Coder
    Join Date
    Nov 2003
    Location
    Code Heaven
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yup,works.
    Thx alot dude!

  • #10
    New Coder
    Join Date
    Jan 2004
    Location
    UK
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no problem


  •  

    Posting Permissions

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