PHP mail - equivalent of the repeat region in the body?
My client wants a summary of the products registered in the body of an email. My mail script works great, but I don't know how to add the summary of products (what I call a 'repeat region").Thanks in advance for your advice and comments
Hi David,
Thanks for the help and apologies for not being precise.
My recordset looks like:
cust_id product_name order_date
PRODUCTA 100 23/12/08
100 PRODUCTB 23/11/07
100 PRODUCTC 22/09/07
For example, a client may have 1 or 100 items, so you can see why I want to create the equivalent of a region that is repeated in the body of the message.
It is more useful to you?
Tags: Dreamweaver
Similar Questions
-
PHP Mail: Recordset in the Message field
So I'm just learning to work with PHP in DW C3 and I am puzzled how include a my recordset field in the message.
As you can see, my e-mail is a typical password reset. I want to include the password in the body of the message here:
$message. = "" password: \n ";"
What is the syntax?
Thank youFigured it out:
Just added
$password = $row_rs_password ["password"];
then updated the message:
$message. = "" password: $password \n\n ";"
-
Mail send and the body of the email and the attachment to ATG.
Hi all
Can any body explain to me how I will send an email with the body of the email and attachments in ATG.
Thank you
Chadnra mohanYou can use atg.service.email.MimeMessageUtils or javax.mail.internet.MimeMessage (both are under Message classes).
You can set the body to aid below extracted.
Message MSG = MimeMessageUtils.createMessage ();
msg.setText ("your body of the email");You can define the setting and the content using below extracts.
define the content of the message: message to multiple parties + attachment
ContentPart happy [] =
{New ContentPart ("it's clear","text/plain" ""),}
{New ContentPart ("this is text html" , "text/html")};
Attachment of files = new File ("attachment.html");
MimeMessageUtils.setContent (msg, content, seizure, false);All of these are clearly explained in the link below.
http://docs.Oracle.com/CD/E24152_01/platform.10-1/ATGPlatformProgGuide/HTML/s1013creatingjavamailmessages01.html
Thank you
Gopinath Ramasamy -
PHP mail can be disabled or misconfigured web server.
Hi, I build a Web site for a client. They organize the Web site using a 3rd party hosting company.
Download of the Web site on their FTP server, I get the following message:
1 WARNING
PHP mail can be disabled or misconfigured web server.
These forms can not send email. Contact your Web host or administrator of the Web site on the correct configuration of PHP mail.
The client contacted their host and that's what they were saying;
We checked with the contact form: http://wsportscoaching.com/contact-us.html and found that there is a problem with it, because disable PHP mail on the server for security reasons, where you suggest to you please contact your Web site programmer and change the form code email with SMTP authentication code, it will solve the problem with the contact form.
--
SMTP Username and password: use your domain e-mail address and the password.
SMTP PORT: 25
SMTP HOST: wsportscoaching.com
I didn't belive this is correct, please could someone help me with this problem?
A big thank you Darren.
Hello
If you check Muse PHP Diagnostics
You should see the problem with the configuration of PHP on the server.
Please take a look at this document and see if it is useful.,.
Troubleshooting Muse form used on the servers of third party Widgets
Let me know if you have any question.
-
With Mail 9.2, iCloud mail displays only the body of the subject; to view the message body requires restart Mail 9.2 every time. See also an accumulation of e-mail messages not appearing in the box iCloud mail drafts mailbox.
A
Please, back up all data. Rebuild the mailbox.
B
From the Mail menu bar, you select
▹ mail preferences... ▹ Accounts ▹ behaviors of the ball
and uncheck the box marked
Store drafts on the server
-
repeating region of php email function doesn't work do not
I have a form which should be sent by electronic mail and like products attached to it. However, I have a repeat region to list all products, but when I send the e-mail Island shows that the first item on the list.
below is the form set up
emailer
E-mail information new tenant
$to = ' [email protected] ';// . ',' . "$row_rsOrder ['email']";
$to = $row_rsOrder ['email'];
$subject = "order details";
$message ="
< html >
< head >
< title > Dear ".» $row_rsOrder ["FirstName"]. $row_rsOrder ["LastName"]. "Please see the details of your order below < /title >
< / head >
< body >
" < img src =-" http://www.website.com/images/logoBLPP.jpg \" alt=\"" />
Your order of B < h2 >. $row_rsOrder ["OrderID"]. "< / h2 >
< table width = "800" border = "0" cellspacing = "0" cellpadding = "0" >
< tr > < td > < p > thank you for shopping below are you details of the order you placed recently. If you have any questions please contact us < /p >
< br / >
< /a > < /p >
< tr > < td > < table > < /tr > < / table >
< table width = '980' border = "1" cellspacing = "0" cellpadding = "10" >
< tr valign = "top" >
< td bgcolor = "#E9E9E9" class = "header1" > Customer Name < table >
< class td 'text' = > "." $row_rsOrder ["FirstName"]. $row_rsOrder ["LastName"]. "< table >
< td bgcolor = "#E9E9E9" class = "header1" > Order ID < table >
< td bgcolor = "#E9E9E9" class = "text" > "." $row_rsOrder ["OrderID"]. "< table >
< td bgcolor = "#E9E9E9" class = "header1" > status command < table >
< class td 'text' = > "." $row_rsOrder ["TransactResult"]. "< table >
< /tr >
< tr valign = "top" >
< td bgcolor = "#E9E9E9" class = "header1" > Email < table >
< class td 'text' = > "." $row_rsOrder ['email']. "< table >
< td bgcolor = "#E9E9E9" class = "header1" > < table >
< class td = "text" > < table >
< td bgcolor = "#E9E9E9" > < span class = "header1" > </span > < table > Order Date
< class td 'text' = > '.makeDateTime ($row_rsOrder ["OrderDate"], '%#d %B %Y', true). "< table >
< /tr >
< tr valign = "top" >
< td bgcolor = "#E9E9E9" class = "header1" > shipping address < table >
< class td = "text" > < p > "." $row_rsOrder ['address']. "< /p >
< p > "." $row_rsOrder ['city']. "< /p >
< p > "." $row_rsOrder ['postal code']. "< /p >
< p > "." $row_rsOrder ['country']. "< /p >
< p > < /p > < table >
< td > < table >
< td > < table >
"< td colspan ="2"align ="right"valign ="bottom"> < span class ="head"> ORDER TOTAL: DoFormatCurrency ($row_rsOrder ['Total'], 2, ','.', ' £', ""). "". "< br / >"
"</span > < span class ="text"> shipment: DoFormatCurrency (['shipping'], 2 $row_rsOrder, ','.', ' £', ""). "". "</span > < span class ="head"> < br / >"
</span > < table >
< /tr >
< tr valign = "top" >
< td bgcolor = "#E9E9E9" class = "header1" > Product ID < table >
< td bgcolor = "#E9E9E9" class = "header1" > < table > Product Description
< td bgcolor = "#E9E9E9" colspan = "2" class = "header1" > size < table >
< td bgcolor = "#E9E9E9" > < span class = "header1" > quantity </span > < table >
< td bgcolor = "#E9E9E9" align = "right" > < span class = "header1" > price </span > < table >
< /tr >
<? php do { ?>
< tr valign = "top" >
< class td 'text' = > "." $row_rsOrder ['ProductID']. "< table >
< class td 'text' = > "." $row_rsOrder ['product']. «, ». $row_rsOrder ["productGroupGUID"]. "< table >
< td colspan = "2" class = "text" > "." $row_rsOrder ["UnitSize"]. "< table >
< td > < span class = "text" > "." $row_rsOrder ['quantity']. "</span > < table >
< td align = 'right' class = "text" > ". DoFormatCurrency ($row_rsOrder ["UnitPrice'"], 2, ','.', ' £', ""). "." "< table >
< /tr >
<? php } while ($row_rsOrder = mysql_fetch_assoc($rsOrder)); ?>
< tr valign = "top" >
< class td = "text" > < table >
< class td = "text" > < table >
< td colspan = "2" class = "text" > < table >
< td > < table >
< td > < table >
< /tr >
< /table >
< / body >
< / html >
";
Content-type always defined when sending HTML email
$headers = "MIME-Version: 1.0 '. « \r\n » ;
$headers. = "content-type: text / html;" Charset = UTF-8 ". « \r\n » ;
$headers. = "from: company name < " [email protected] > '. "\r\n";
$send = mail ($ $subject, $message, $headers);
Yes, all THE information in the database was recovered and sent to the email. Only 3 products for test purposes.
I just tested it down to the do-while loop. After that html table code is absent.
You have to bare in mind, this is a crude test. The updated database in place the query is not as complex as yours is, so maybe it's why his work, but certainly break the 'message' is the way to go. I can try to get another table products tomorrow if I have time to test.
Database to html code and column names are the same as you have. the recordeset is "rsOrders" instead of "Mina" that you used.
<>
If (! function_exists ("GetSQLValueString")) {}
function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
If (via PHP_VERSION< 6)="">
$theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;
}
$theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);
Switch ($theType) {}
case 'text ':
$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
break;
case "long":
case "int":
$theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';
break;
case "double":
$theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';
break;
case "date":
$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
break;
case "set":
$theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
break;
}
Return $theValue;
}
}
@mysql_select_db ($database_conDonations, $conDonations);
$query_rsOrders = "SELECT * FROM orders";
$rsOrders = mysql_query ($query_rsOrders, $conDonations) or die (mysql_error ());
$row_rsOrders = mysql_fetch_assoc ($rsOrders);
$totalRows_rsOrders = mysql_num_rows ($rsOrders);
emailer
E-mail information new tenant
$to = ' [email protected]'; / /. ',' . "$row_rsOrder ['email'];
$to = $row_rsOrder ['email'];
$subject = "order details";
$message ="
Dear ".» $row_rsOrders ["FirstName"]. "see your order below details ' http://www.website.com/images/logoBLPP.jpg-' alt =------"------" / >
Your order of B. $row_rsOrders ["OrderID"]. »
Thank you for shopping below are you details of the order you placed recently. If you have any questions please contact us
Name of the customer «. $row_rsOrders ["FirstName"]. » Command ID «. $row_rsOrders ["OrderID"]. » Status of orders «. $row_rsOrders ["TransactResult"]. » E-mail «. $row_rsOrders ['email']. » Order date «. $row_rsOrders ["OrderDate"]. » Shipping address «. $row_rsOrders ['address']. »
«. $row_rsOrders ['city']. »
«. $row_rsOrders ['postal code']. »
«. $row_rsOrders ['country']. »
ORDER TOTAL: "." $row_rsOrders ['total']. » Shipping: "." $row_rsOrders ["expedition"]. »
";Product ID Product description Size Quantity Price ?>
"?> «. $row_rsOrders ['product']. » «. $row_rsOrders ["UnitSize"]. » «. $row_rsOrders ['quantity']. » «. $row_rsOrders ['UnitPrice']. » ";
?>