1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

php mail() function not sending emails

Discussion in 'PHP' started by IDconsulting, Feb 23, 2011.

  1. #1
    Hi there
    I've got a small php mail() function here, which doesn't seem to be sending emaisl whatever I do. (I've hidden all the details for obvious reasons)

    Any idea whats going wrong? Thanks
     
    IDconsulting, Feb 23, 2011 IP
  2. Martin K

    Martin K Active Member

    Messages:
    262
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    For mail() to work you must have a SMTP enabled on the server. check this and write back. If you test it local its 100% sure that you don't have :)
     
    Martin K, Feb 23, 2011 IP
  3. IDconsulting

    IDconsulting Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    How would I test whether smtp is enabled on the server? It's not working locally either.
     
    IDconsulting, Feb 24, 2011 IP
  4. yohanip

    yohanip Well-Known Member

    Messages:
    350
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #4
    maybe the sendmail service is not configured correctly
     
    yohanip, Feb 24, 2011 IP
  5. Sabbir

    Sabbir Banned

    Messages:
    210
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Hi,
    I think "To: " is not required in header. try to send email removing this part.
    if it doesn't work then try to
    use phpinfo() to check the smtp status in your server

    thanks
     
    Sabbir, Feb 24, 2011 IP
  6. Alex Roxon

    Alex Roxon Active Member

    Messages:
    424
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    80
    #6
    If you have root access to the server, check the exim log.

    tail var/log/exim_mainlog
     
    Alex Roxon, Feb 24, 2011 IP
  7. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #7
    it reallly doesn't matter ;)
    Only problem is disabled SMTP
     
    G3n3s!s, Feb 25, 2011 IP
  8. ddmd

    ddmd Peon

    Messages:
    60
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    ddmd, Feb 26, 2011 IP
  9. pdurvasula

    pdurvasula Member

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #9
    Hi
    I am having a greeting card site. When a customer fills a form and sends it is relayed by sendmail
    to the receipient the informaion contained therein.
    The script is set to
    $smtp_server='localhost';
    There was no problem with this till my web host made some modifications and now he says:
    "The send mail path and the document root you are using are correct.
    You must be able to send mails using the PHP mail scripts.
    However kindly note that, we have placed some rigid rules on the server to avoid
    spamming activities such that you will not be able to send emails using any script
    if you are not using a proper valid email account which is created under the domain
    'telugugreetings.net'. So kindly make sure that you are using any email accounts created
    under this domain in the 'From' address field in the mail script to send mails. :
    I am having email account '" created under my domain."
    The SMTP server is mail.telugugreetings.net, port 465
    Please help me what modifications I have to make to the script to work properly.
    Thanks
     
    pdurvasula, Jan 16, 2015 IP