text 非常简单的HTML电子邮件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 非常简单的HTML电子邮件相关的知识,希望对你有一定的参考价值。

	<?php
	/*
	 * $template->post_title();
	 *
	 */
 
 
	?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title><?php print $template->post_title(); ?></title>
                <!-- POST ID: <?php print $post_id ?> -->
     <style type="text/css">
 		 .icon-table {
 		 	text-align: center !important;
            margin: 0 auto;
 		 }
 		 #bodyTable a {
 		 	color:#0d4fa7;
 		 	border-bottom: 2px solid #00aa79;
 		 	text-decoration: none;
 		 }
 		 a:hover {
 		 	text-decoration: none;
 		 }
 		  @media (max-width:580px) {
 		 	 #image-columns img {
 		 		max-width: 100%;
 		 	 }
 		 	 #image-columns td:nth-child(even) {
 		 		width:4px;
 		 	 }
 		  }
  		 @media (max-width: 414px) {
  		 	 table{
   		 		width: 100% !important;
   		 	}
   		 	.h1-class {
   		 		font-size: 20px !important;
   		 		line-height: 26px !important;
   		 	}
  			.header-table td {
   		 		vertical-align: middle;
   		 		width: 170px;
   		 	}
  	    .header-table img {
   		 		max-width: 139px;
   		 	}
  			 .view-browser {
  			 	font-size: 10px !important;
  				line-height: 13px;
  			 }
  		 }
   		 @media (max-width:320px) {
   		 	.header-table img {
   		 		max-width: 100px;
   		 	}
   		}
     </style>
	</head>
	<body bgcolor="#ffffff" style="background-color:#fff; color: #333333; font-family: arial,sans-serif;width:100%; margin: 0;">
		<center style="background-color: #fff;">

			<table border="0" cellpadding="0" cellspacing="0" style="background:transparent; width: 100%;padding:0; margin:0;">
				<tr>
					<td height="4" align="center" valign="top" style="background:#0d4fa7; height:4px"></td>
				</tr>
			</table>

			<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; background: #fff">
				<tr>
					<td align="center" valign="top" style="font-size: 12px; line-height: 125%; color: #808080; font-family: Arial;">
						<table border="0" cellpadding="0" cellspacing="0" id="cw" style="color:#676767;border: none; width: 632px;">
							<tr>
								<td height="29" align="center" valign="top" style="line-height:8px;height:29px"></td>
							</tr>
							<tr>
								<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
								<td>
									<table class="header-table" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="400" valign="top" align="left" style="font-family: Arial;font-size: 12px; color: #333333; text-align: left;">
												<a href="<?php echo home_url(); ?>" >
													<img width="138" src="https://www.eklips.se/east/obos-logo.png" style="line-height:8px;border: none;vertical-align:middle; text-align:left;" alt="logo" />
												</a>
											</td>
											<td class="view-browser" width="200" valign="center" align="right" style="font-family: Arial; color:#333333;; font-size: 12px; text-align: right; margin:0;">Is the content not displaying correctly? <a style="color:#0d4fa7; text-decoration: none; border-bottom: 2px solid #00aa79" href="*|WEBLINK|*" target="_blank">View it in your browser</a></td>
										</tr>
									</table>
								</td>
								<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
							</tr>
							<tr>
								<td height="20" align="center" valign="top" style="line-height:8px;height:20px"></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			<table border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td width="632" style="width: 632px; font-family: Arial;font-size: 12px; background: white;">
						<table align="center" border="0" cellpadding="0" cellspacing="0" style="height: 100%;" width="100%" id="bodyTable">
							<tr>
								<td align="center" id="bodyCell" style="text-align: left !important"><!-- text-align-comment -->
									<table border="0" cellpadding="0" cellspacing="0" id="cw">
										<tr>
											<td>
												<table border="0" cellpadding="0" cellspacing="0"  style="" width="100%" >
													<tr>
														<td height="26" align="center" valign="top" style="line-height:8px;height:26px"></td>
													</tr>
													<tr>
														<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
														<td style="font-family: Arial , sans-serif;">
															<h1 class="h1-class" style="font-family: Arial, sans-serif; margin: 0; padding: 0; font-size: 28px; line-height: 38px; color:#0d4fa7; font-weight: bold; margin-top: 0px;"><?php print $template->post_title(); ?></h1>
														</td>
														<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
 
													</tr>
 
													<tr>
														<td height="5" align="center" valign="top" style="line-height:8px;height:5px"></td>
													</tr>
 
 
 
													<tr>
														<td height="10" align="center" valign="top" style="line-height:8px;height:10px"></td>
													</tr>
													<?php if($template->post_content()): ?>
														<tr id="post-content">
															<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
															<td style="font-size: 14px; color: #333333; line-height: 150%;font-family: Arial; padding-bottom: 15px;">
																<?php print $template->post_content('#00ae4d'); ?>
															</td>
															<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
														</tr>
													<?php endif; ?>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<?php if($post_id): ?>
								<?php if($template->post_related_images()): ?>
									<tr>
										<td height="20" align="center" valign="top" style="line-height:8px;height:0px;"></td>
									</tr>
									<tr id="related-images" >
										<td align="center">
											<table border="0" cellpadding="0" cellspacing="0" width="100%">
												<tr>
													 <td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
													<td align="left" style="font-family: Arial, sans-serif;line-height:23px;color:#1d2a30;" valign="top"><h1 style="font-size: 20px; font-family: Arial, sans-serif; font-weight: bold;">Images</h1></td>
													<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
												</tr>
												<tr>
													<td height="10" width="10" align="center" valign="top" style="line-height:8px;height:10px; width: 10px;"></td>
													<td height="10" valign="top" style="line-height:8px;height:10px"></td>
													<td height="10" width="10" align="center" valign="top" style="line-height:8px;height:10px; width: 10px;"></td>
												</tr>
												<tr>
													<!-- --><td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
													<td>
														<table border="0" cellpadding="0" cellspacing="0" width="100%" id="image-columns" >
															<?php print $template->post_related_images('189') ?>
														</table>
													</td>
													<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
												</tr>
												<tr>
	<!-- 							-->	<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
									<td height="30" align="center" valign="top" style="line-height:8px;height:30px;"></td>
									<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td> <!--  -->
								</tr>
							</table>
						</td>
					</tr>
				<?php endif; ?>
				<?php if($template->post_related_links()): ?>
<!-- 					<tr>
						<td height="10" align="center" valign="top" style="line-height:8px;height:10px; border-top: none;"></td>
					</tr> -->
					<tr id="related-links" >
						<td align="center">
							<table border="0" cellpadding="0" cellspacing="0" width="100%"  style="text-align: left !important">
								<tr>
									<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
									<td align="left" style="font-family: Arial, sans-serif;line-height:23px;" valign="top"><h1 style="font-size: 20px;font-family: Arial, sans-serif; font-weight: bold; margin:0;">Links</h1></td>
									<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
								</tr>
								<tr>
									<td height="10" width="10" align="center" valign="top" style="line-height:8px;height:10px; width: 10px;"></td>
									<td height="10" valign="top" style="line-height:8px;height:10px"></td>
									<td height="10" width="10" align="center" valign="top" style="line-height:8px;height:10px; width: 10px;"></td>
								</tr>
								<tr>
									<!-- --> <td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
									<td>
										<table border="0" cellpadding="0" cellspacing="0" width="100%" style="font-size: 14px;">
											<?php print $template->post_related_links('#0d4fa7', '14') ?>
										</table>
									</td>
									<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
								</tr>
								<tr>
	<!-- -->								<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
										<td height="20" align="center" valign="top" style="line-height:8px;height:20px;"></td>
										<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td> <!-- -->
									</tr>
								</table>
							</td>
						</tr>
					<?php endif; ?>
					<?php if($template->post_related_documents()): ?>
						<!--<tr>
							<td height="10" align="center" valign="top" style="line-height:8px;height:10px; border-top: none;"></td>
						</tr>-->
						<tr id="related-documents" style="/*margin-top: -45px; display: block;*/"> <!-- hacky feeling -->
							<td align="center">
								<table border="0" cellpadding="0" cellspacing="0" width="100%"  style="text-align: left !important">
									<tr>
										<!-- --> <td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
										<td align="left" style="font-family: Arial, sans-serif; line-height:23px;" valign="top"><h1 style="font-size: 20px; font-family: Arial, sans-serif; font-weight: bold; margin:0;">Documents</h1></td>
										<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
									</tr>
									<tr>
											<td height="10" width="10" align="center" valign="top" style="line-height:8px;height:10px; width: 10px;"></td>
											<td height="10" valign="top" style="line-height:8px;height:10px"></td>
											<td height="10" width="10" align="center" valign="top" style="line-height:8px;height:10px; width: 10px;"></td>
										</tr>
										<tr>
											<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
											<td>
												<table border="0" cellpadding="0" cellspacing="0" width="100%" style="font-size: 14px;" >
													<?php print $template->post_related_documents('#0d4fa7', '14') ?>
												</table>
											</td>
											<td height="20" width="40" align="center" valign="top" style="line-height:8px;height:20px; width: 16px;"></td>
										</tr>
										<tr>
											<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
											<td height="20" align="center" valign="top" style="line-height:8px;height:30px"></td>
											<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
										</tr>
										<tr>
											<td height="50" width="10" align="center" valign="top" style="line-height:8px;height:50px; width: 10px;"></td>
											<td height="50" align="center" valign="top" style="line-height:8px;height:50px;"></td>
											<td height="50" width="10" align="center" valign="top" style="line-height:8px;height:50px; width: 10px;"></td>
										</tr>
									</table>
								</td>
							</tr>
						<?php endif; ?>
					<?php endif; ?>
				</table>
			</td>
		</tr>
		<!-- <tr>
			<td height="40" align="center" valign="top" style="line-height:8px;height:16px;"></td>
		</tr> -->
	</table>
	<table border="0" cellpadding="0" cellspacing="0" style="background:#0d4fa7; width: 100%;">
		<tr>
			<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
			<td align="center" valign="top">
				<table border="0" cellpadding="0" cellspacing="0" style="width: 632px; text-align: center;">
					<tr>
						<td>
							<table border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td height="30" width="40" align="center" valign="top" style=" width: 16px; line-height:8px;height:30px"></td>
									<td align="center" valign="top" style="font-size: 12px; line-height: 125%; color: #ffffff; font-family: Arial;">
										<?php if($post_id): ?>
											<table border="0" cellpadding="0" cellspacing="0" id="cw" style="color: #ffffff;border: none;">
												<tr>
													<td height="36" align="center" valign="top" style="line-height:8px;height:43px"></td>
												</tr>
												<tr>
													<td width="632" valign="top" style="font-family: Arial;font-size: 14px; color:#fff; line-height: 1.67;">© Lorem ipsum dolor sit amet © Lorem ipsum dolor sit amet© Lorem ipsum dolor sit amet© Lorem ipsum dolor sit amet© Lorem ipsum dolor sit amet© Lorem ipsum dolor sit amet© Lorem ipsum dolor sit amet© Lorem ipsum dolor sit amet© Lorem ipsum dolor sit amet© Lorem ipsum dolor sit amet</td>
												</tr>
												<tr>
													<td height="30" align="center" valign="top" style="line-height:8px;height:33px;"></td>
												</tr>
												<tr>
													<td width="632" valign="top" align="" style="font-family:Arial; font-size: 14px; line-height: 20px;"><a style="color: #ffffff;text-decoration:none; border-bottom: 2px solid #00aa79;" href="*|UNSUBSCRIBE|*">Unsubscribe</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #ffffff; text-decoration: none; border-bottom: 2px solid #00aa79;" href="*|MODIFY|*">Settings</a></td>
												</tr>
												<tr>
													<td height="45" align="center" valign="top" style="line-height:8px;height:45px"></td>
												</tr>
											</table>
										<?php endif; ?>
									</td>
									<td height="30" width="40" align="center" valign="top" style="width: 16px; line-height:8px;height:30px"></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
			<td height="20" width="10" align="center" valign="top" style="line-height:8px;height:20px; width: 10px;"></td>
		</tr>
	</table>

	
</center>
</body>
</html>

以上是关于text 非常简单的HTML电子邮件的主要内容,如果未能解决你的问题,请参考以下文章

text 基于表格的HTML用于HTML电子邮件

在带有附件的电子邮件中将内容类型从 text/plain 转换为 text/html

在 HTML 电子邮件中发送图像

text HTML电子邮件等

text 只需单击按钮或预定时间,即可将数据从MySQL数据库提取到Google doc电子表格。这对re来说非常有用

在 Python 中发送带有 HTML+plain_text 电子邮件的 PDF 附件