Mail not sending

software development

#1

I just moved my site up to dreamhost and am having some issues with sending mail via php. Is there anything you need to do on DH to make mail(); work? Or should I use some other system?

Thanks!


#2

It’s a fairly typical setup. Are you getting an error message?


#3

No error messages. Are there logs anywhere I can check. I get access denied on the mail.log when I SSH into the host. This is my function I’m using… I shortened it for this post but it’s pretty basic:

function sendWelcome($user, $email, $pass, $file){
  $from = "From: ".NAME." <".ADDR.">";
  $subject = "Welcome!";
  $body = $user.",\n\n"
      ."Welcome!"
  mail($email,$subject,$body,$from);
  return;
  }

That should work, shouldn’t it?


#4

Your problem looks like it is because these two lines are formatted incorrectly:

[php]$body = $user.",\n\n"
.“Welcome!”[/php]

Do this:
[php]$body = $user.",\n\n
Welcome!";[/php]


#5

The problem turned out to be… well… not sure! :wink:

I opened a support case with DH. They tested it and said it was fine. And it was… my code worked.