PeggyBuckham Posted October 10, 2012 Share Posted October 10, 2012 (edited) I have a page on my website that sends out a simple html email. This page worked a few days ago. Then last night when I was showing my client, it worked, but the email did not display properly (html code was visible in the email). Then today I can not get it to work at all. I have not changed my code, and I am using a script that I have used a lot of times. I'm not familiar with all the php settings on a server. I assume that one of these settings below are conflicting with each other. mail.add_x_header -- on mail.force_extra_parameters -- no value mail.log -- no value sendmail_from -- no value sendmail_path -- /usr/sbin/sendmail -t -i MAILTO -- root Also I had a similar problem a week ago. The email was not being sent out, then I played around with it, but did not actually change anything and it started to work again. Edited October 10, 2012 by PeggyBuckham Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 10, 2012 Share Posted October 10, 2012 Are there errors? Does the call to mail() in your script now return TRUE or FALSE? Quote Link to comment Share on other sites More sharing options...
PeggyBuckham Posted October 10, 2012 Author Share Posted October 10, 2012 No errors, and it returns TRUE Quote Link to comment Share on other sites More sharing options...
premiso Posted October 10, 2012 Share Posted October 10, 2012 Some times the mailqueue can be messed up. On this server, do you control the mail server? It returns TRUE because it was accepted by the mail system, whether it was sent out is upto the mail server. One thing to try is specify the "from" as from a valid email on the domain, or something like "no-reply@domain.com" and see if that helps. Quote Link to comment Share on other sites More sharing options...
PeggyBuckham Posted October 11, 2012 Author Share Posted October 11, 2012 OK I will try that. Yes I/we do control the mail server. It is a dedicated server from Godaddy. One of my co-workers upgraded the server and that is when the problem started. Quote Link to comment Share on other sites More sharing options...
premiso Posted October 11, 2012 Share Posted October 11, 2012 (edited) Yea, do you know what mailserver you are using? (postfix exim ... ?) That would help if you still cannot get it working. And as this is more than likely a server configuration issue, I moved it appropriately. Edited October 11, 2012 by premiso Quote Link to comment Share on other sites More sharing options...
PeggyBuckham Posted October 11, 2012 Author Share Posted October 11, 2012 So I actually have to places where the code i wrote sends out an email. One of them already had the "from" from noreply@mysite.com. This morning I tested the sytem and it was working for both email. I had them sent to two diffrent email addresses each (4 emails). ...the system worked this morning, but it does not work now. I allso noticed that the emails being sent to my personal email were displaying the html code/tags. I am going to see what happens if I send out emails that are not htmls. This smight be a clue. Quote Link to comment Share on other sites More sharing options...
PeggyBuckham Posted October 11, 2012 Author Share Posted October 11, 2012 Sorryi just saw the reply you left this morning. I will look... I have no idea how to figure out what mailserver I am using? But I will look into it. Quote Link to comment Share on other sites More sharing options...
PeggyBuckham Posted October 11, 2012 Author Share Posted October 11, 2012 So i do not understant mail servers: POP3, SMTP etc.. I got the emails to work by taking out the html code. This is not a solution. It is a work around. For the moment I am going to let it go becouse I did not have any complecated emails to send out on this site. Thank You premiso, for your help! I am not going to mark this as solved, but I am going to move on to other work Quote Link to comment Share on other sites More sharing options...
premiso Posted October 11, 2012 Share Posted October 11, 2012 Gotcha, just something to think about, maybe your mailserver was denying the html because of improper headers / mime type? Anyhow, something for you to look into when the time comes. Best of luck! Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted October 11, 2012 Share Posted October 11, 2012 are you using something like PHPmailer <?php require("class.phpmailer.php"); $mail = new PHPMailer();$mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "smtp1.example.com;smtp2.example.com"; $mail->SMTPAuth = true; $mail->Username = 'smtpusername'; $mail->Password = 'smtppassword'; $mail->From="mailer@example.com"; $mail->FromName="My site's mailer"; $mail->Sender="mailer@example.com"; $mail->AddReplyTo("replies@example.com", "Replies for my site"); $mail->AddAddress("email@example.com"); $mail->Subject = "Test 1"; $mail->IsHTML(true); $mail->Body = "<h1>Test 1 of PHPMailer html</h1><p>This is a test</p>"; $mail->AltBody="This is text only alternative body."; if(!$mail->Send()) { echo "Error sending: " . $mail->ErrorInfo;; } else { echo "Letter is sent"; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.