www.webdeveloper.com
Results 1 to 4 of 4

Thread: Trouble sending simple email

  1. #1
    Join Date
    Nov 2006
    Posts
    172

    Trouble sending simple email

    im trying to get a simple email send using php

    the form for getting the info
    HTML Code:
    <html>
    <head><title>send mail</title></head>
    
    <body>
    <form method="POST" enctype="multipart/form-data" action="sendmixed.php">
    	<table>
    		<tr><td>To: </td>
    			<td><input type="text" name="to" size="40"></td>
    		</tr>
    		<tr>
    			<td>From: </td>
    			<td><input type="text" name="from" size="40"></td>
    		</tr>
    		<tr>
    			<td>Message:</td>
    			<td><textarea rows="5" name="comments" cols="33"></textarea></td>
    		</tr>
    		<tr><td colspan = "2"><input type="submit" value="send" name="send"></td></tr>
    	</table>
    </form>
    </body>
    </html>
    the php code for processing it
    PHP Code:
    <?
    $to 
    $_POST['to'];
    $re $_POST['from'];
    $comments $_POST['comments'];

    $msg $comments;
    #send mail
    $ok mail($to$re$msg);
    if(
    $ok) echo "OK"

    ?>
    gives me this error and i don't know what its telling me exactly

    Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\program files\easyphp1-8\www\new folder\sendmixed.php on line 8

  2. #2
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,742
    That's because you don't have a mailexchanger.

  3. #3
    Join Date
    Nov 2006
    Posts
    172
    the book i have doesn't mention anything about that how do i set one up or is it too much hastle

  4. #4
    Join Date
    Nov 2006
    Posts
    172
    i've reading up a bit more on it but im not quite sure what to do

    can i set up in the php.ini file to use my hotmail or gmail account

    for example can i set it up in php.ini like this
    [mail function]
    ; For Win32 only.
    SMTP = mail.hotmail.com
    smtp_port = 25

    ; For Win32 only.
    sendmail_from = me@hotmail.com

    i have outlook set up on my machine

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles