I need to send mail to test locally in my machine with php code. I have configured php with iis server I am using windows 7 . I need to send mail to my email id using php code.
Please help on this.
Thank you
I need to send mail to test locally in my machine with php code. I have configured php with iis server I am using windows 7 . I need to send mail to my email id using php code.
Please help on this.
Thank you
How far have you got with this?
I did not do anything please assist me from first.
Don’t use the default mail()
function. This only works if you are really really lucky. I once got mine to work, but then one day, it just stop working. The alternative would be to use PHPMailer because PHPMailer works without having to setup a mail server. You just need to understand how to use SMTP. You can actually use your actual email address to get SMTP to work or your actual server email.
Have you at least written the HTML form?
As @spaceshiptrooper says, have a look at PHPMailer for sending the email. I doubt you want to be setting up a mail server on your local machine.
bool mail(string $to, string $subject, string $message)
Finally, here’s a small example on how to combine it all and send the email:
<?php
ini_set('SMTP','localhost');
ini_set('sendmail_from', 'Your.Own@Address.com');
$to = 'Someone@somewhere.com';
$subject = 'Example subject';
$body = 'With an example body…';
mail($to, $subject , $body);
?>
Without a SMPT server you can use testMailServer.exe…works a treat with mail() for local testing. Some SMTP will not allow you to use their SMTP service unsolicited and therefore you’ll have to provide log-in etc. That said, you don’t have to use SMTP either. For local testing use the above tool…
Hi,
Thanks for your response. Now I have setup and able to send the mail using phpmailer. Now problem is I need to embed inline image to the mail. But If I add the exact image path I am able to attach inline image. But here image data stored the in database as “base64” encoded string. I need to attach inline image to the mail by using the base64 string data. Please assist me on this.
Thanks in advance.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.