FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Email problem





bloodrider
I wanted to change to google apps, so I changed my nameservers from frih to my old ones so I could change my MX records.
Everything went OK, I configured everything correctly, and the mail address ([snipped]) that I had with frih it's currently working in google.
The problem, on my site I've a mail form (working in PHP and it works correctly!) that send an email to that address but the emails aren't being received at google. Then I noticed it was still sending them to frih, so I went to DirectAdmin and deleted the [snipped] at frih, but this didn't solve the problem.
What do I have to do? It's some configuration missing on DirectAdmin, do I've to disable email there? I searched but I don't see nothing more to change that has to do with mail...


Thanks in advance Wink
mOrpheuS
bloodrider wrote:
I've a mail form (working in PHP and it works correctly!) that send an email to that address but the emails aren't being received at google. Then I noticed it was still sending them to frih

Most likely, it's because the php mail() function in the form is handling the mail locally (it knows that your domain is hosted on the same server after all).

You should consider using a mail form that uses smtp instead of php mail() function.
bloodrider
Are you saying to use an external SMTP server?

Meanwhile I remembered, maybe the problem it's been caused by TTL, after some time the DNS cache will be renewed and the problem will be solved?
Do you have access to clean the cache, couldn't you do that for me, or does it involve to much problems? On frih nameservers what's the normal TTL (like, how much time would I've to wait)?
mOrpheuS
bloodrider wrote:
Are you saying to use an external SMTP server?

Yes. More specifically, configure your mail form/script to use the Google SMTP servers (which you have your domain's MX delegated to).

bloodrider wrote:
Meanwhile I remembered, maybe the problem it's been caused by TTL, after some time the DNS cache will be renewed and the problem will be solved?
Do you have access to clean the cache, couldn't you do that for me, or does it involve to much problems? On frih nameservers what's the normal TTL (like, how much time would I've to wait)?

The TTL is the default 86400 seconds, I believe.

However, I doubt it has anything to do with that.

To my knowledge, the DNS cache has cleared at least once since you started this thread (name server service restart).
bloodrider
OK, thanks for your help.
I'll try to solve the problem by using an external SMTP server.
The topic can be closed Wink
mk12327
Hi, I had faced a similar problem too but as my hosting is on server 1, I'm using cPanel instead of DirectAdmin. For my case, I did tests on my server and found that it was not the mail() function that is having problem but rather Google mail server wasn't receiving my emails. I was able to use a separate form to send between 2 hotmail accounts.

What I did was to add MX entries for my domain in cPanel so that google apps mail server will be able to receive the emails. (put aspmx.l.google.com as the highest piority mx entry) Note that it may take up to 48 hours to have it fully propagated. There are 2 comprehensive google apps help articles on this issue too. You can access them at https://www.google.com/support/a/bin/answer.py?answer=55299&topic=11543 and http://www.google.com/support/a/bin/answer.py?answer=33352&hl=en_GB.

Anyway, in layman terms, if you had parked your domain or addon domain to your frihost hosting, the cPanel or DirectAdmin assumes that they are responsible for the handling of emails and thus when someone sends an email, it does not go to Google apps but rather to your frihost hosting. When you delete your mail accounts on your frihost, it does not solve the problem as the emails simply got lost or bounce back when they could not find the relevant email address on your frihost account. What you need to do (or at least it worked on my case) would be to add mx entries on your cPanel or DirectAdmin to point to Google Apps. This way, when emails come in, they are in a way diverted to google mail server through the mx entry.

Honestly I simply loved the Frihost + Google Apps combination. So much features packed in them and yet they are free. I admit i'm not a guru in either of them but i'm constantly exploring them. Let me know if this work for you.
mOrpheuS
An excellent explanation on the issue, mk12327.

There is, however, one small problem.
The thread starter is hosted on server 2 - DirectAdmin, which doesn't provide the option of modifying MX entries.
mk12327
Do you mean that the changing of MX entries on DirectAdmin was disabled by frihost? Because I checked the forums on DirectAdmin and there seems to be an area for changing MX entries under email menu > mx records. One example is http://www.directadmin.com/forum/showthread.php?t=1284
bloodrider
Thanks for your help mk12327, but as I said in my first post that wasn't the problem, I've configured my MX records correctly and I'm receiving the emails for my domain.
The problem concerns to a mail form (hosted here in frihost) that still sends the emails to a local mail account instead of the correct one on googleapps Sad
Maybe I didn't explained to well my problem, as English isn't my primary language, sorry Embarassed

PS: At server2 we can't change our MX records.
mk12327
No problem. Hope you could resolve your issue soon. =) When you finally get it solved you could even post your solution here so that people who get a similar problem in server 2 could have their problems resolved too.
bloodrider
To solve this issue I used PHPMailer.
This way I only had to adapt my mail form code to use their mailer.
In their package they have some examples, and the one that I used is the following one:
Quote:
<?php

// example on using PHPMailer with GMAIL

include("class.phpmailer.php");
include("class.smtp.php");

$mail=new PHPMailer();

$mail->IsSMTP();
$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

$mail->Username = "yourname@gmail.com"; // GMAIL username
$mail->Password = "password"; // GMAIL password

$mail->From = "replyto@yourdomain.com";
$mail->FromName = "Webmaster";
$mail->Subject = "This is the subject";
$mail->Body = "Hi,<br>This is the HTML BODY<br>"; //HTML Body
$mail->AltBody = "This is the body when user views in plain text format"; //Text Body

$mail->WordWrap = 50; // set word wrap

$mail->AddAddress("username@domain.com","First Last");
$mail->AddReplyTo("replyto@yourdomain.com","Webmaster");
$mail->AddAttachment("/path/to/file.zip"); // attachment
$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment

$mail->IsHTML(true); // send as HTML

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

?>


Problem solved Very Happy


PS: Don't forget to upload the php files mentioned on "include" Razz
Related topics
Horde Email Problem
Email Problem
[SOLVED] == Thunderbird, POP3 email problem not solved
Email problem - =?iso-8859-1?Q?
Problem with email through Thunderbird
Email Problem
email problem
Email Config : MX record and passwor
Where is bondings?
Email forwarder problem
email problem DirectAdmin Unable to send
Problem in topic name in reply notification email
Please help me to Retrieve this, Admin!
Server 4 problems (17-20-01-2012)
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.