Welcome Guest, Not a member yet? Register   Sign In
Path to Attachment Folder Fails[Newbie]
#1

[eluser]Unknown[/eluser]
Hi,

Created an "attachments" directory inside "application" attempted using the following to send attachment.

----Config.php-----
Code:
$config['base_url'] = 'http://localhost:8888/CI/netuts_day_03/index.php/';
$config['server_root'] = $_SERVER['DOCUMENT_ROOT'];


----Config-email.php------
Code:
<?php  if ( !defined('BASEPATH')) exit('No direct script access allowed');

$config['protocol'] =  'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] =  465;
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'notapassword';

----Email-Controller-----
Code:
$path = $this->config->item('server_root');
   //attachments
   $file = $path .'/netuts_day_03/attachments/myattach.txt';
  
   $this->email->attach($file);


The following error is returned:

Quote:Your email was sentUnable to locate the following email attachment: /Applications/MAMP/htdocs4/netuts_day_03/attachments/myattach.txt
220 mx.google.com ESMTP y4sm10564657pbe.4

Also the message is not sent when this failure occurs. Commenting the attach() out sends the message.

I've changed the permissions, on both folder and file, stumped.

MAMP 1.9.5
OSX 10.5.8
CI 2.0.3




Theme © iAndrew 2016 - Forum software by © MyBB