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

problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mi

Force download script not handling files with spaces properly
I have a regular old php force download script, uses this code:

Code: header("Cache-Cont

Parse Error
Hi Guys,

I have a function in my class which returns a string link variable. The problem is i

Issue Parsing XML into table
Hello all,

Im a bit new to php and new to phpfreaks. But thanks in advance for the help!
<

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

C - Reading a file into a byte array
Hi,

I'm trying to read a file into a byte array in C. I have to use C as this is for a loadru

What are causes of a connection-timeout with fopen()?
Hello! Here is the situation: The server I host my website on just upgraded it's PHP build from 4.4.

MySQL Does not UPDATE- SQLString Problem
vb Syntax (Toggle Plain Text) 1. SQL = "UPDATE sampletable SET column1 = 'C1sample1'"

Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related codi

how do i make a string??
hey guys,
can someone please tell me how to put data from the glob function into a string

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