I have got XAMPP installed on my MAC.
When I execute the code I get no errors but do not get an email in my account.
Following is the code in my .php and php.ini file. Any ideas / suggestions on why this does not work?
test.php
<?php
$to = "dubeystuts@gmail.com";
$subject = "test email";
$message = "test";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: akshyasharma02@gmail.com" . "\r\n";
/* Have also tried with and without the following two lines
ini_set(‘SMTP’, ’smtp.suddenlink.com’);
ini_set(’smtp_port’,25);
*//
mail ($to, $subject, $message, $headers);
?>
php.ini
[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25
SMTP=smtp.suddenlink.com.np
smtp_port=25
; For Win32 only.
;sendmail_from = me@example.com
sendmail_from = akshyasharma02@gmail.com
ISP provider is suddenlink.com. Do I need to ask ISP provider to enable emails from localhost? Do I need the email id on the ISP in sendmail_from field?
An early reply will be much appreciated. Many thanks for reading the post.
Best regards,
Stuti