0

I want to send email from myid@mysite.com. I have configured my wamp as per this stackoverflow link below above code works fine to send using gmail account but not using other domain account e.g. Want to send from myid@mysite.com.

Please guide me.

In php.ini I have made following changes

<?php
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = my-gmail-id@gmail.com
sendmail_path = "\"D:\wampp\sendmail\sendmail.exe\" -t"
?>

In sendmail.ini I have changed code to

<?php

    [sendmail]

    smtp_server=smtp.gmail.com
    smtp_port=587
    error_logfile=error.log
    debug_logfile=debug.log
    auth_username=my-gmail-id@gmail.com
    auth_password=my-gmail-password
    force_sender=my-gmail-id@gmail.com

    ?>
Cœur
  • 37,241
  • 25
  • 195
  • 267
Vijaya Savant
  • 135
  • 4
  • 19

1 Answers1

0

Instead of using sendmail.exe, I suggest you use the library PHPMailer.

You have an example here: Basic Example using Gmail

Navid EMAD
  • 382
  • 1
  • 15
  • I have also tried for above code but it's giiving me error as : Fatal error: Class 'SMTP' not found in D:\wamp\www\....\class.phpmailer.php on line 1291 – Vijaya Savant Jul 21 '15 at 10:59
  • Have you download the library before ? https://raw.githubusercontent.com/PHPMailer/PHPMailer/master/class.phpmailer.php – Navid EMAD Jul 21 '15 at 11:02
  • yes, I've downloaded too. That's why I tried above code, which is not showing error but not sending mail too.. I am using wamp on win 7 starter. – Vijaya Savant Jul 21 '15 at 11:05
  • Also I want to send email to any type of email id including gmail. – Vijaya Savant Jul 22 '15 at 04:23