Hello,
I have set up on an xp pro, Dreamweaver 8, installed apache,php & Mysql using xampp, all function ok so far. However now I am trying to follow the lesson 5 for newlands website by writing code to send mail and I am not having any look.
PHP code in training from source book is as follows
<?php
$to = "yourname@yourserver.com";
$subject = "This is the message subject";
$body = "This is the message body";
$headers = "From: yourname@yourserver.com\n"
;
mail($to,$subject,$body,$h
eaders);
?>
$to was changed to myname@myisp also $headers
then mail($to, changed to smtp.myisp
Have tried editing the sendmail.ini & the php.ini to point to my normal email settings but this is the error I get
Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini.
Extract for ini
[sendmail]
; you must change mail.mydomain.com to your smtp server
smtp_server=smtp.myisp.co.
uk
; if your smtp server requires authentication, modify the following two lines
auth_username="my account name"
auth_password="password"
; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines
pop3_server="pop3.myisp.co
.uk"
pop3_username="my account name"
pop3_password="password"
; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required
;hostname=localhost
PHP.ini EXTRACT
[mail function]
; For Win32 only.
SMTP = smtp.myisp.co.uk
smtp_port = 25
; For Win32 only.
sendmail_from = me@myisp.co.uk
I would be very grateful if you would guide me through the process of what is set wrong
Thank you
Start Free Trial