Phpmailer help


#1

i try for a week to make the mail code work and i fail every time, i get this error with php mailer :

SMTP -> FROM SERVER:
220 homiemail-a72.g.dreamhost.com ESMTP
SMTP -> FROM SERVER:
250 homiemail-a72.g.dreamhost.com
SMTP -> FROM SERVER:
250 2.1.0 Ok
SMTP -> FROM SERVER:
554 5.7.1

SMTP -> FROM SERVER: 220 homiemail-a72.g.dreamhost.com ESMTP SMTP -> FROM SERVER: 250 homiemail-a72.g.dreamhost.com SMTP -> FROM SERVER: 250 2.1.0 Ok SMTP -> FROM SERVER: 554 5.7.1 : Client host rejected: Access denied SMTP -> ERROR: RCPT not accepted from server: 554 5.7.1 : Client host rejected: Access denied SMTP -> FROM SERVER: 554 5.5.1 Error: no valid recipients SMTP -> ERROR: DATA command not accepted from server: 554 5.5.1 Error: no valid recipients SMTP -> FROM SERVER: 221 2.0.0 Bye Message could not be sent.
Mailer Error:

honestly i dont know what i can do, can you guys please tell me what is wrong? here is the code:
[php]require ‘lib/phpmailer/phpmailer.inc.php’;
$mail = new PHPMailer();

$body = “test”;

$mail->IsSMTP();

$mail->SMTPDebug = 2;

$mail->Host = “mail.tutoriale-la-gramada.com”;
$mail->SMTPAuth = true;
$mail->Username = "adminn@tutoriale-la-gramada.com"; //
$mail->Password = “this is the pass”;

$mail->Port = 587;	
$mail->From = "adminn@tutoriale-la-gramada.com";
$mail->FromName = "john doe";
$mail->AddAddress("only_cosmynn@yahoo.com", "coss");

$mail->AddReplyTo("adminn@tutoriale-la-gramada.com", "admin");
		
$mail->WordWrap = 50;                                
$mail->IsHTML(true);                                  
		
$mail->Subject = "PHPmailer example";
$mail->Body    = "This is a test of email";
					
if(!$mail->Send()){
	echo "Message could not be sent. <p>";
	echo "Mailer Error: " . $mail->ErrorInfo;
	exit;
}[/php]

please help me, i really need to make this work, i am out of time


#2

Try a different address here:

$mail->AddAddress("only_cosmynn@yahoo.com", “coss”);


#3

the thing is that i really want it to work with yahoo, please can someone help me?


#4

if you tried using the above code with a different To: address and it functioned correctly then Yahoo is blocking the mail server and there’s nothing anyone here can do about it.

Inform Support via Panel

Issue is “Email”, all websites, Relay server denied (or something like that).

Use the SERVER IS ON FIRE FFS!!! all caps message as the request type and, for good measure, select the “No offence but I probably know more about this than you do” under your expertise level - because chances are high that by now you probably DO know more about the issue than the first person who reads the ticket.


#5

i will submit a ticket again, last time i submited they were not useful at all …
it does not metter to what email i send it , yahoo, gmail, work-mail… i always get the same error


#6

Seems to be saying the recipient email address is not valid, therefor there is no email to send. So something is wrong with that line, perhaps that’s not the correct way to specify the “To” address.


#7

honestly i dont see anything wrong with the code, i looked many phpmailing examples and they are the same.
[hr]
i hagend the port to 465 and now i get this error:
SMTP -> FROM SERVER: SMTP -> FROM SERVER: SMTP -> ERROR: HELO not accepted from server: SMTP -> NOTICE: EOF caught while checking if connectedMessage could not be sent.
Mailer Error:

at least now i dont have as many errors as before


#8

They were cock blocked at a couple of places when I looked the other day.

Who handles your work email? Who handles your “DreamHost” email address?


#9

the dreamhost account is me personal account, i use it for my own projects, all i wanna do is to be able to send confirmation email address to the person that registers to my site, and small announces when there are, that is all,


#10

It is totally handled at DreamHost? It is not a domain mail handled by Google Mail or something weird?


#11

all is from dreamhost, i bought the host from dream host + domain, i dont use any external data or domain or anything


#12

[php]<?php

require_once ‘class.phpmailer.php’;
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->Host = ‘mail.[realdomain.tld]’;
$mail->SMTPAuth = true;
$mail->Username = ‘[user]@[realdomain.tld]’;
$mail->Password = ‘[mail_user_password]’;
$mail->SMTPSecure = ‘tls’;

$mail->From = ‘[user]@[realdomain.tld]’;
$mail->FromName = ‘PHP Mailer’;
$mail->AddAddress(‘someone@gmail.com’, ‘Their Name (optional)’);
$mail->AddReplyTo(‘no-reply@[realdomain.tld]’, ‘No-Reply’);

$mail->WordWrap = 50;
$mail->IsHTML(true);

$mail->Subject = ‘Here is the subject’;
$mail->Body = ‘This is the HTML message body in bold!’;
$mail->AltBody = ‘This is the body in plain text for non-HTML mail clients’;

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

// just to output something…
echo ‘Message has been sent’;
?>
[/php]


#13

well i tried your code and i get this

SMTP -> FROM SERVER:
220 homiemail-a30.g.dreamhost.com ESMTP
SMTP -> FROM SERVER:
250 homiemail-a30.g.dreamhost.com
SMTP -> FROM SERVER:
250 2.1.0 Ok
SMTP -> FROM SERVER:
554 5.7.1

SMTP -> FROM SERVER: 220 homiemail-a30.g.dreamhost.com ESMTP SMTP -> FROM SERVER: 250 homiemail-a30.g.dreamhost.com SMTP -> FROM SERVER: 250 2.1.0 Ok SMTP -> FROM SERVER: 554 5.7.1 : Client host rejected: Access denied SMTP -> ERROR: RCPT not accepted from server: 554 5.7.1 : Client host rejected: Access denied SMTP -> FROM SERVER: 554 5.5.1 Error: no valid recipients SMTP -> ERROR: DATA command not accepted from server: 554 5.5.1 Error: no valid recipients SMTP -> FROM SERVER: 221 2.0.0 Bye Message could not be sent.Mailer Error:


#14

This archive contains the class files used with the code above while testing a From: DreamHost-handled mailing account via SMTP and sending To: @gmail, @yahoo, etc. common bulk mail handlers : http://sxi.sabrextreme.com/files/phpmailer/phpmailer522.tar.gz

They’re the same as the latest hosted at Google Code. There’s no need to edit these by the way. Double triple check that your code (or the test code posted previously) that calls them is really using legitimate, real, and properly formatted email addresses.