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 ...?

Did you know?Explore Trending and Topic pages for more stories like this.
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

NOOB needs help with upload file
The intent of this form is to create a folder for a client and upload an image into another folder '

Using system() and bringing back the results
I am aware that you can use system() within PHP to execute system commands, but I was wondering if t

getting Vars to pass to next page.
Hello all,
I have a confusing situation on my hands, i am a member of a gaming community and we

problems with script
I made a small script wich exchanges points in my website:


<?php
session_start

Troubles with a spider class
I am building a spider that will crawl through random whitepages (eg. anywho.com, switchboard.com, w

double and single quotes in text fields acting up... help please
Single quotes, when entered into a text field, create an sql error upon Submit. It seems to create t

get the country of visitor and display content based on that
Hello all,

I have seen that Google analytics can tell you where a visitor is coming from and

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

Display certain image depending on time of year
Hi, I am new to these forums and would really appreciate some advice on a piece of coding I have don

PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see

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