Jump to content

Somethings wrong with my email


Niixie

Recommended Posts

Hey, i've made this code thats supposed to email me.

-It worked for some time ago, then i edited it and cant get it working again.

 

<?php
session_start();

//Gram slik udregning
$gram_blandet = $_SESSION["blandet"]*40;
$gram_ananas = $_SESSION["ananas"]*40;
$gram_banan = $_SESSION["banan"]*50;
$gram_jumbo = $_SESSION["jumbo"]*50;
$gram_cashew = $_SESSION["cashew"]*30;
$gram_pistacie = $_SESSION["pistacie"]*30;
$gram_mandler = $_SESSION["mandler"]*30;
$ialt = $gram_blandet+$gram_ananas+$gram_banan+$gram_jumbo+$gram_cashew+$gram_pistacie+$gram_mandler;

//Kommentar ting
if($_SESSION["kommentarer"] == "Skriv dem her") $comment = "Ingen";
else if(strlen($_SESSION["kommentarer"]) == 0) $comment = "Ingen";
else $comment = $_SESSION["kommentarer"];


//Email information
$txt_message = '
	<html>
	<body>
        <h2>Ordre på Kloneslik</h2>
        <p>'.$_SESSION["navn"].' har bestilt klone slik.</p><br />
	<table border="0">
		<tr>
			<td><h2>Forsendelses information</h2></td>
		</tr>
		<tr>
			<td width="350">Navn: </td>
			<td>'.$_SESSION["navn"].'</td>
		</tr>
		<tr>
			<td width="350">Addresse: </td>
			<td>'.$_SESSION["addresse"].'</td>
		</tr>
		<tr>
			<td width="350">Postnummer: </td>
			<td>'.$_SESSION["postnummer"].'</td>
		</tr>
		<tr>
			<td width="350">Telefon: </td>
			<td>'.$_SESSION["telefon"].'</td>
		</tr>
		<tr>
			<td><h2>Slik</h2></td>
		</tr>
		<tr>
			<td width="350">Blandet Mix 40g: </td>
			<td>'.$_SESSION["blandet"].'</td>
		</tr>
		<tr>
			<td width="350">Ananas 40g Tørrede: </td>
			<td>'.$_SESSION["ananas"].'</td>
		</tr>
		<tr>
			<td width="350">Banan 50g Tørrede: </td>
			<td>'.$_SESSION["banan"].'</td>
		</tr>
		<tr>
			<td width="350">Jumbo rosiner 50g: </td>
			<td>'.$_SESSION["jumbo"].'</td>
		</tr>
		<tr>
			<td width="350">Cashewnødder 30g Ristet og Saltet: </td>
			<td>'.$_SESSION["cashew"].'</td>
		</tr>
		<tr>
			<td width="350">Pistacienødder 30g Saltet: </td>
			<td>'.$_SESSION["pistacie"].'</td>
		</tr>
		<tr>
			<td width="350">Mandler 30g Ristet og saltet: </td>
			<td>'.$_SESSION["mandler"].'</td>
		</tr>
		<tr>
			<td><hr /></td>
		</tr>
		<tr>
			<td width="350">Poser ialt: </td>
			<td>'.$_SESSION["blandet"]+$_SESSION["ananas"]+$_SESSION["banan"]+$_SESSION["jumbo"]+$_SESSION["cashew"]+$_SESSION["pistacie"]+$_SESSION["mandler"].'</td>
		</tr>
		<tr>
			<td width="350">Gram slik ialt: </td>
			<td>
				'.$ialt.'
			</td>
		</tr>
		<tr>
			<td><h2>Andet</h2></td>
		</tr>
		<tr>
			<td>Yderligere kommentarer:</td>
			<td>
				'.$comment.'
			</td>
		</tr>
	</table>
	</body></html>';

$to = "email@email.email";
$subject = "Test";
$message = $txt_message;
$headers = "From: Klone slikbestilling" .
	"MIME-Version: 1.0\r\n" .
	"Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to,$subject,$message,$headers);
?>

 

Its the first time i've tried to make a system like that, and it is in the top of the script.

Can anyone tell me whats wrong with it?

Link to comment
Share on other sites

You are missing the CR-LF pair after the From: header.

 

	$headers = "From: Klone slikbestilling\r\n" .
	"MIME-Version: 1.0\r\n" .
	"Content-Type: text/html; charset=ISO-8859-1\r\n";

 

Also, the value of the From: header has to be a valid email address on the sending server. (I'm guessing you took it out for this post, but just make sure it is there when you send it).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.