This post was last edited by u011552243 on 2013-08-20 20:08:40
PHP echo Email
Problem background: I want to output a form and email this form as content.
Problem: Code First,
$message = '
'; $message. = ' Driver: '; $message. = $firstName. ' '. $lastName; $message. = ' |
Date: '. $orderTime. ' |
No:1 |
Car '. $truck. ': '. ' '. $licNum; $message. = ' |
Kund: '. $customerName. ' |
Order: '. $orderNum. ' |
'; $message. = ' Book Number: '. $bookNumPick. ' |
Produktnamn: '. $productName. ' |
Chassi: '; $message. = $tankName. ' |
Tank number: '. $chassi. ' |
Place: '. $locationPick. ' |
Place 2: '; $message. = $portCodePick. ' |
Place 3: '. $locationUnload. ' |
Place 4: '; $message. = $timeUnload. ' |
Place 5: '. $ADRclass. ' |
Place 5: '. $weight. ' |
Place 6: '; $message. = $locationLoad. ' |
Place 7: '. $loadTime. ' |
Place 8: '; $message. = ' |
'. $info. ' |
Place 9: '. $outE. ' |
Place ten: '. $bookNumOut. ' |
Place 11: '; $message. = $portCodeOut. ' |
|
'; echo $message. "
"; $to = $email; $subject = "Task"; $from = EMAIL; $headers = "From: $from"; echo $headers. "
"; Mail ($to, $subject, $message, $headers);
To illustrate, I used double quotation marks at the beginning, and later, in order to keep the contents of the $message in double quotes, I changed the outer double quotation marks to single quotes.
In fact, I want the content of the email to be the result of Echo $message. But using the mail () function to send the $message directly, the results received are:
。。。。 (omitted, visible $message) ..... |
|
Directly is the content inside the $message directly sent out, rather than the echo $message after the results of the outgoing.
What to do?
If convenient, can you point to the key code snippets or examples, thank you very much.
Reply to discussion (solution)
Problem background: I want to output a form and email this form as content.
Problem: Code First,
$message = '
'; $message. = ' Driver: '; $message. = $firstName. ' '. $lastName; $message. = ' |
Date: '. $orderTime. ' |
No:1 |
Car '. $truck. ': '. ' '. $licNum; $message. = ' |
Kund: '. $customerName. ' |
Order: '. $orderNum. ' |
'; $message. = ' Book Number: '. $bookNumPick. ' |
Produktnamn: '. $productName. ' |
Chassi: '; $message. = $tankName. ' |
Tank number: '. $chassi. ' |
Place: '. $locationPick. ' |
Place 2: '; $message. = $portCodePick. ' |
Place 3: '. $locationUnload. ' |
Place 4: '; $message. = $timeUnload. ' |
Place 5: '. $ADRclass. ' |
Place 5: '. $weight. ' |
Place 6: '; $message. = $locationLoad. ' |
Place 7: '. $loadTime. ' |
Place 8: '; $message. = ' |
'. $info. ' |
Place 9: '. $outE. ' |
Place ten: '. $bookNumOut. ' |
Place 11: '; $message. = $portCodeOut. ' |
|
'; echo $message. "
"; $to = $email; $subject = "Task"; $from = EMAIL; $headers = "From: $from"; echo $headers. "
"; Mail ($to, $subject, $message, $headers);
To illustrate, I used double quotation marks at the beginning, and later, in order to keep the contents of the $message in double quotes, I changed the outer double quotation marks to single quotes.
In fact, I want the content of the email to be the result of Echo $message. But using the mail () function to send the $message directly, the results received are:
。。。。 (omitted, visible $message) ..... |
|
Directly is the content inside the $message directly sent out, rather than the echo $message after the results of the outgoing.
What to do?
If convenient, can you point to the key code snippets or examples, thank you very much.
Solve it yourself. where $headers = "From: $from". "\ r \ n";;
$headers. = "mime-version:1.0\n". "Content-type:text/html; Charset=utf-8 ' ";
Can. Knot stickers.