phpMailer not working ..........


Posted on 16th Feb 2014 07:03 pm by admin

HI,
I was playing with the phpMailer script and tried to send a smiple mail using their test script from my site ..... it said "send again" but i am not getting mail ..........
Does anybody know what could have went wrong ...?

Code:
Code: <?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
include_once('class.phpmailer.php');

$mail = new PHPMailer(); // defaults to using php "mail()"

$body = $mail->getFile('contents.html');
$body = eregi_replace("[]",'',$body);

$mail->From = "president@******.org";
$mail->FromName = "President's Address";

$mail->Subject = "PHPMailer Test Subject via mail()";

$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test

$mail->MsgHTML($body);

$mail->AddAddress("*******@yahoo.com", "Anoop D");
$mail->AddAddress("*******@gmail.com", "Anoop D");

//$mail->AddAttachment("member.gif"); // attachment

if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent again!";
}





?>Can anybody help with this ... or does my server supports only smtp ...?

No comments posted yet

Your Answer:

Login to answer
138 Like 40 Dislike
Previous forums Next forums
Other forums

Open/Close Links in Php
Hello, Hoping someone can inform me how I can get PHP to automatically open a set of links in a new

Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment

How to set pass login name from htaccess to php
When the user logs into my members page via htaccess, I'd like to retain the username so that I can

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

How to assign JS screen.width to ASP.Net variable
I've got this ASP.net routine that gets the cookie value of the screen width, but now I need to chan

MVC - Code review
I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to impl

sql problems
I am having a small problem with my sql statement. it is inserting into 4 of the fields.

fie

selectbox+database connection retrive problem
Code: [Select]
<tr>
<th align="left" scope="c

Output Buffering question
Hi all,

I've been trying to wrap my head around output buffering. So far I've found tons of

Using Microsoft Exchange Server with PHP
Hi,

I wanted to know if its possible to fetch email attachments from the exchange server usin

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash