mail attachment problem???

Hi guys,

thanx in advance

We are sending a .pdf and .txt files as attachment but attacment content is blank page in case of txt file and could not open pdf file??If yuo have any idea please

tell.

We also tried Swift mailer extension

The code is as follows…


Yii::import('ext.swiftMailer.SwiftMailer');

$plainTextContent = "This is my Plain Text Content for those with cheap emailclients ;-)\nThis is my second row of text";

$SM = Yii::app()->swiftMailer;

$mailHost = 'http://wikiwin.avalonnet.be';

$mailPort = 25; // Optional

 

	// New transport

$Transport = $SM->smtpTransport($mailHost ,$mailPort);

 

	// Mailer

$Mailer = $SM->mailer($Transport);

 

	// New message

	$Message = $SM

    	->newMessage('My subject')

    	->setFrom(array('admin@avalonnet.be' => 'Example Name'))

    	->setTo(array('rohit@xsysys.com' => 'Recipient Name'))

    	->addPart($content, 'text/html')

    	->setBody($plainTextContent)

 		->attach(Swift_Attachment::fromPath('http://wikiwin.avalonnet.be/voucherpdfs/output.pdf'));

  

	// Send mail

	$result = $Mailer->send($Message);



In Morzilla browser i m getting error like this…

[html]Connection could not be established with host

http://wikiwin.avalonnet.be [Unable to find the socket transport "http" -

did you forget to enable it when you configured PHP? #-1401723312] [/html]

In my PHP config file Socket support is enabled ,OpenSSL support is also enabled…

It may be silly error but you find what is missing please tell…

Try to set the $mailHost without ‘http://’




$mailHost = 'wikiwin.avalonnet.be';