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 8 of 8
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    E-Mail isnt be sent.

    So my first question on this forum anyway, I have tried to send e-mail through php and when I tried it out, it would give no error and something would pop up saying symantec scanning and it was go to 100% in like a second so it should of sent the mail, but I never received it.

    PHP Code:
    <?php
        $to 
    "address@yahoo.com"
        
    $from "USER"
        
    $subject "Test"
        
    $body "This is just a test message"
        print 
    "Thanks for contacting us.<br><br>"
        
    mail ($to,$subject,$body,$from);
    ?>
    ***Yes I did substitute address with my real E-Mail***
    Does anybody know what could be wrong? I am using Windows 2000 and IIS.

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Welcome here!

    The first thing to consider is that the mail function doesnt take a "from" argument, so you need to do this:

    $header = "From: email@address.com\r\n";

    Secondly, is windows set up to send mail? I have heard of problems with the PHP support before. Im afraid I dont know much about this.

    PHP Code:
    <?php
        $to 
    "address@yahoo.com"
        
    $header "From: USER\r\n"
        
    $subject "Test"
        
    $body "This is just a test message"
        if(
    mail ($to,$subject,$body,$header)){
           print 
    "Thanks for contacting us.<br /><br />"
        } else {
           print 
    "Mail could not be sent<br /><br />";
        }
    ?>

  • #3
    New Coder
    Join Date
    May 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm pretty sure it does cause I opened IIS and I "granted permission to relay e-mail through this SMTP virtual server" but of course I could be wrong.
    Last edited by Haunted; 05-02-2004 at 03:52 AM.

  • #4
    New Coder
    Join Date
    May 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, sorry didn't know
    Last edited by Haunted; 05-02-2004 at 06:15 PM. Reason: I broke the rules oops

  • #5
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    We dont allow bumping of topics...

    If your thread is not answered then the chances are nobody knows how to help you... Please remember this in the future.

  • #6
    New Coder
    Join Date
    Mar 2004
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts
    did you add a smtp server in the php.ini file?

  • #7
    New Coder
    Join Date
    May 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I checked the ini file and did a text search and found this:

    [mail function]
    ; For Win32 only.
    SMTP = localhost

    I don't have to add anything to that do I?

  • #8
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Well assuming that IIS is configured like that I would imagine not, but shouldn't the smtp have it's own IP?
    Omnis mico antequam dominus Spookster!


  •  

    Posting Permissions

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