views:

118

answers:

2

I am using Zend Framework to send mail.

It's doing something very odd, the content type, content dispostion, MIME version and content type encoding are all showing up in the header section (under the subject) of the email in GMail and in Outlook.

The content of the email was also being included twice in the email, once as plain text and once as HTML. I stopped this by just using setBodyText() instead of using setBodyHtml() too. I had seen somewhere that you can use both. Now I just use setBodyText() like this

$mail = new Zend_Mail('utf-8');
$mail->addTo("[email protected]");
$mail->setSubject("Registration info");
$mail->setFrom('[email protected]', "A Name");
$mail->setBodyText($this->view->render('emails/register.phtml'));
$mail->send();

Any ideas anyone on what is going on here?

Thanks for your time

A: 

Please include more information with your question. I suggest at least:

  • Platforms for both your local machine and your live server
  • The default transport on both machines (for example: sendmail?)
  • The version of Zend Framework you are using (there have been recent, important updates to Zend_Mail in nightly builds)
  • The output of 'Show Original' when you send a test email to a gmail account
  • The content of the email template including the encoding type and line endings of the file
yenta
Local is Mac OS X, and live is Linux, CentOS 5.4Not sure on the default transport for the Mac, for CentOS I have it set up using qmailZF 1.10.0The content for the template and email I will get today.Thanks for your time yenta
jakenoble
A: 

This has been solved. It was an error with the host receiving the email. The fact it was in Outlook or GMail made no difference as the error was with the host.

jakenoble
What was the problem with the host?
Randell