Page 1 of 1
Jacek's send HTML mail issue
Posted: Thu Oct 18, 2012 10:10 am
by Fidbeck
I wanted to send an email as HTML and I followed Jacek's video on how to send HTML mails but I'm getting a problem here...
$headers = array(
'From: plus1@something.net',
'Content-Type: text/html'
);
mail($for, $subject, $body, implode("\r\n", $headers));
is is giving me an error
Error: There is 1 array declaration that contain text character variables or values without quotations:
array( 'From:
plus1@something.net', 'Content-Type: text/html' );
but if I put it like
$headers = array('From: plus1@something.net',
'Content-Type: text/html'
);
it works fine.
So should I change the inplode into just $headers or what?
Re: Jacek's send HTML mail issue
Posted: Thu Oct 18, 2012 5:48 pm
by jacek
Those two things should be the same :S That is not a standard PHP error, do you have some kind of debugging tool that is making stupid mistakes ?
Re: Jacek's send HTML mail issue
Posted: Thu Oct 18, 2012 5:49 pm
by Fidbeck
I checked for the code here phpcodechecker.com
Re: Jacek's send HTML mail issue
Posted: Thu Oct 18, 2012 5:51 pm
by jacek
Fidbeck wrote:I checked for the code here phpcodechecker.com
Don't do that, it's apparently pretty bad
Adding or removing a line break should not change the way anything functions.
Re: Jacek's send HTML mail issue
Posted: Thu Oct 18, 2012 5:52 pm
by Fidbeck
That's what I thought but it shows as error lol
Is there any other place to do that?
Re: Jacek's send HTML mail issue
Posted: Thu Oct 18, 2012 5:56 pm
by jacek
Fidbeck wrote:That's what I thought but it shows as error lol
Is there any other place to do that?
Just try the script locally and see what the result is, a website is never going to produce a better error than php can
Re: Jacek's send HTML mail issue
Posted: Thu Oct 18, 2012 6:05 pm
by Fidbeck
I'm having some problems with that lol
I use Dreamweaver CS6 and is not configured to run PHP files... I also use WebMatrix and when I run my contact it gives me a 404.20 HTTP error page...
HTTP Error 404.20 - Not Found
some time ago I had Wamp but had to delete it because the port :80 was already being used (maybe by WebMatrix) and I couldn't make it work properly.
Re: Jacek's send HTML mail issue
Posted: Sun Oct 21, 2012 6:40 pm
by Temor
Fidbeck wrote:I'm having some problems with that lol
I use Dreamweaver CS6 and is not configured to run PHP files... I also use WebMatrix and when I run my contact it gives me a 404.20 HTTP error page...
HTTP Error 404.20 - Not Found
some time ago I had Wamp but had to delete it because the port :80 was already being used (maybe by WebMatrix) and I couldn't make it work properly.
It's usually skype that occupies port 80, but it could also be Pando media booster or TeamViewer. Check for any of those under the processing tab in your task manager.
Re: Jacek's send HTML mail issue
Posted: Mon Oct 22, 2012 12:20 am
by Fidbeck
The thing is that I never, ever had any of those programs installed
Re: Jacek's send HTML mail issue
Posted: Mon Oct 22, 2012 7:34 am
by Temor
pando media booster isn't a program you install. it comes with lots of different games to enhance performance. it's not visible unless you look in the process tab in your task manager.
Re: Jacek's send HTML mail issue
Posted: Mon Oct 22, 2012 8:31 am
by Fidbeck
This is all I have opened for now.
Re: Jacek's send HTML mail issue
Posted: Sat Oct 27, 2012 9:48 pm
by jacek
You can try
XAMPP it's the easiest way I know of to set up a local testing thingy.
Re: Jacek's send HTML mail issue
Posted: Sun Oct 28, 2012 8:43 pm
by Fidbeck
I've already tried XAMPP in the past but since I couldn't make it work because the port it was listening was port 80 and it seems that that port was already being used. In a near future will format my HD so i'll install it then.
Re: Jacek's send HTML mail issue
Posted: Mon Oct 29, 2012 12:55 pm
by jacek
Fidbeck wrote:I've already tried XAMPP in the past but since I couldn't make it work because the port it was listening was port 80 and it seems that that port was already being used. In a near future will format my HD so i'll install it then.
You should be able to edit the port it uses if you can find the config files for Apache, there will be something like
Listen 80
somewhere, just change that to an unused port.
Re: Jacek's send HTML mail issue
Posted: Tue Oct 30, 2012 5:00 am
by Fidbeck
I only changed in the httpd.conf file everything related to any port, being the listen or for instance 127.0.0.1:80
but i'm going to format my computer in a near future so i'll try that out. In another computer I have I don't have Webmatrix or Dreamweaver installed and Xampp works nicely. I bet it's Webmatrix that is ruining this stuff