2

I am trying to make an application which can parse emails and update the database. I tried to set up the localhost to send and receive emails so that I can carry on from there. I am unable to do that. I tried configuring Outlook, Thunderbird to set up local email system using mercury mail server. Its not working properly.

I would like to have a step by step procedure explaining how to make this work.

5 Answers 5

1

hi try this it will work..... download phpmailer.zip github.com/PHPMailer/PHPMailer

simple code for send mail:

<?php
    require 'PHPMailerAutoload.php';

    $mail = new PHPMailer;

    $mail->isSMTP();                                      
    $mail->Host = 'smtp.gmail.com'; 

    $mail->SMTPAuth = true;                             
    $mail->Username = '[email protected]';                           
    $mail->Password = 'ur password';                           
    $mail->SMTPSecure = 'tls';                          
    $mail->From = '[email protected]';
    $mail->FromName = 'mailer';
    $mail->addAddress('[email protected]');  
    $mail->addAddress('[email protected]');             
    $mail->addCC('[email protected]');
    $mail->addBCC('[email protected]');
    $mail->WordWrap = 50;                                
    $mail->isHTML(true);                                 
    $mail->Subject = 'Here is the subject';
    $mail->Body    = 'This is the HTML message body <b>in bold!</b>';

    if(!$mail->send()) {
       echo 'Message could not be sent.';
       echo 'Mailer Error: ' . $mail->ErrorInfo;
       exit;

}
?>
Sign up to request clarification or add additional context in comments.

Comments

0

For sending emails via SMTP in PHP you only have to change SMTP = localhost in the [mail function] section of PHP.INI to the SMTP of your ISP. Also you need to change the port for some ISPs that block the default port (25). Exemple:

[mail function]
SMTP = mail.mydomain.com
smtp_port = 2525

2 Comments

i did that as well... but something is wrong!! I followed these steps -> tech2all.com/2006/03/12/how-to-setup-your-own-e-mail-server/… but not working
I did that numerous times in the past with success. Maybe your ISP block port 25?
0

You could try configuring a local mail server that allows you to sent to and receive from localhost.

Have a look at this link on how to set this up

Comments

0

I found a easy solution for this try this application http://smtp4dev.codeplex.com/

Comments

0

i found a tutorial about it it works fine with me

http://www.synet.sk/php/en/155-testing-php-mail-on-localhost-with-fake-smtp-server-hMailServer-and-outlook

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.