changing email server from x10hosting to gmail app

Status
Not open for further replies.

wifibazaar89

New Member
Messages
8
Reaction score
0
Points
0
i want to know how i can change email server from x10hosting to gmail apps server
mx records setting working fine...
i can send and recive email from admin@wifibazaar.pcriot.com
but php script is not working

tried many scripts and same result

got return msg

admin@wifibazaar.pcriot.com
Gid 14305 is not permitted to relay mail, or has directly called /usr/sbin/exim instead of /usr/sbin/sendmail.

------ This is a copy of the message, including all the headers. ------

Return-path: <wbazaar@lotus.x10hosting.com>
Received: from wbazaar by lotus.x10hosting.com with local (Exim 4.69)
(envelope-from <wbazaar@lotus.x10hosting.com>)


i am new here and need this fix urgent plz help....
thanks in advance.
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
You need to change your PHP script to use gmails SMTP server.
 

wifibazaar89

New Member
Messages
8
Reaction score
0
Points
0
thanks for quick replay after all search about this....
i found in gmail forums to install phpmailer


i figured out then and installed it...

now i need scipt can some one help me with script

i am using this script but its not working
<?php
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('../class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_message = $_POST['cf_message'];
$field_subject = $POST ['cf_subject'];
$body = '$field_message';


$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "admin@wifibazaar.pcriot.com"; // GMAIL username
$mail->Password = "******"; // GMAIL password

$mail->SetFrom('info@wifibazaar.pcriot.com', 'Information department Department');
$mail->AddReplyTo('complain@wifibazaar.pcriot.com', 'complain Department');
$mail->Subject = '$field_subject';
$mail->AddAddress('$field_email', '$field_name');

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



and my html page...

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact Form</title>
</head>
<body>
<form action="gmail.php" method="post">
Your name<br>
<input type="text" name="cf_name"><br>
Your e-mail<br>
<input type="text" name="cf_email"><br>
Subject<br>
<input type="text" name="cf_subject"><br>
Message<br>
<textarea name="cf_message"></textarea><br>
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>
</body>
</html>
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
what errors are you getting? Also, the programming help category could be able to provide better help.
 
Status
Not open for further replies.
Top