Jeg følger en video tutorial på Lynda.com, og er løbet ind i et problem når jeg skal sende emails.
Jeg har installeret Xampp.
- <?php
-
- $to = "my@domain.com";
-
- $subject = "Welcome to the website";
-
- $message = "This is just a test";
-
- $from = "welcome@domain.com";
- $headers = "From: {$from}";
-
- $result = mail($to, $subject, $message, $headers);
-
- echo $result ? 'sent' : 'error';
-
- ?>
Fejlen som jeg får frem i min browser er: Warning: mail() [function.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:\xampp\htdocs\photo_gallery\public\email.php on line 12
error
Har kigget på min .ini fil, men ved ikke om jeg skal ændre noget der?
[mail function]
; For Win32 only.
;
http://php.net/smtpSMTP = localhost
;
http://php.net/smtp-portsmtp_port = 25
; For Win32 only.
;
http://php.net/sendmail-from;sendmail_from = postmaster@localhost
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;
http://php.net/sendmail-path;sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"