Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/09/2011, 14:26
toyeslomao
 
Fecha de Ingreso: diciembre-2010
Ubicación: tenerife
Mensajes: 60
Antigüedad: 13 años, 11 meses
Puntos: 0
Respuesta: erro al envial email local

2º PARTE DEL CODIGO

Código perl:
Ver original
  1. if( $mode eq "BOTH" || $mode eq "EMAIL") {
  2.    # Send email order to you...
  3.    open (MAIL,"|$mailprogram");
  4.    print MAIL "To: $youremail\n";
  5.    print MAIL "From: $b_email\n";
  6.    print MAIL "Subject: New Online Order\n";
  7.    print MAIL "\n\n";
  8.    print MAIL "A new order has been received.  A summary of this order appears below.\n";
  9.    print MAIL "\n";
  10.    print MAIL "Order Date: $months[$month] $day, $year $hour:$min:$sec \n";
  11.    print MAIL " \n";
  12.    print MAIL "Bill To: \n";
  13.    print MAIL "\n";
  14.    print MAIL "   $b_first $b_last \n";
  15.    print MAIL "   $b_addr \n";
  16.    print MAIL "   $b_addr2 \n";
  17.    print MAIL "   $b_city, $b_state  $b_zip \n";
  18.    print MAIL "   $b_phone \n";
  19.   print MAIL "   $b_fax \n";
  20.   print MAIL "   $b_email \n";
  21.   print MAIL " \n";
  22.  print MAIL " \n";
  23.  print MAIL "Ship To: \n";
  24.  print MAIL "\n";
  25.  print MAIL "   $s_first $s_last \n";
  26.  print MAIL "   $s_addr \n";
  27.  print MAIL "   $s_addr2 \n";
  28. print MAIL "   $s_city, $s_state  $s_zip \n";
  29. print MAIL "   $s_phone \n";
  30. print MAIL " \n";
  31. print MAIL " \n";
  32. print MAIL "Qty  Price(\$)   Product ID  - Product Name\n";
  33. print MAIL "\n";
  34.  print MAIL "$QUANTITY_1    \$$PRICE_1  $ID_1 - $NAME_1   $ADDTLINFO_1  \n";
  35.  if( $NAME_2 ) {print MAIL "$QUANTITY_2    \$$PRICE_2    $ID_2 - $NAME_2   $ADDTLINFO_2  \n";}
  36.  if( $NAME_3 ) {print MAIL "$QUANTITY_3  \$$PRICE_3  $ID_3 - $NAME_3   $ADDTLINFO_3  \n";}
  37. if( $NAME_4 ) {print MAIL "$QUANTITY_4  \$$PRICE_4  $ID_4 - $NAME_4   $ADDTLINFO_4  \n";}
  38.  if( $NAME_5 ) {print MAIL "$QUANTITY_5  \$$PRICE_5  $ID_5 - $NAME_5   $ADDTLINFO_5  \n";}
  39.    if( $NAME_6 ) {print MAIL "$QUANTITY_6 \$$PRICE_6  $ID_6 - $NAME_6   $ADDTLINFO_6  \n";}
  40.    if( $NAME_7 ) {print MAIL "$QUANTITY_7 \$$PRICE_7 $ID_7 - $NAME_7   $ADDTLINFO_7  \n";}
  41.  if( $NAME_8 ) {print MAIL "$QUANTITY_8 \$$PRICE_8 $ID_8 - $NAME_8   $ADDTLINFO_8  \n";}
  42.  if( $NAME_9 ) {print MAIL "$QUANTITY_9 \$$PRICE_9 $ID_9 - $NAME_9   $ADDTLINFO_9  \n";}
  43.  if( $NAME_10 ){print MAIL "$QUANTITY_10 \$$PRICE_10 $ID_10 - $NAME_10   $ADDTLINFO_10 \n";}
  44.  if( $NAME_11 ){print MAIL "$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11   $ADDTLINFO_11 \n";}
  45.    if( $NAME_12 ){print MAIL "$QUANTITY_12 \$$PRICE_12 $ID_12 - $NAME_12   $ADDTLINFO_12 \n";}
  46.  if( $NAME_13 ){print MAIL "$QUANTITY_13 \$$PRICE_13 $ID_13 - $NAME_13   $ADDTLINFO_13 \n";}
  47.  print MAIL "\n";
  48. print MAIL "SUBTOTAL: $SUBTOTAL \n";
  49. print MAIL "TOTAL: $TOTAL \n";
  50. print MAIL "\n";
  51. print MAIL "FREIGHT: $SHIPPING \n";
  52. print MAIL "\n\n";
  53. print MAIL "Comments: \n";
  54. print MAIL "\n";
  55. print MAIL "$comment \n";
  56. print MAIL " \n";
  57. close MAIL;
  58. }
  59. if( $mode eq "BOTH" || $mode eq "FILE") {
  60. $csvcomments = $comment;
  61. #$csvcomments =~ s/\"/$csvquote/ig;
  62. open (CSVF,">>$csvfilename");
  63. print CSVF "\"";
  64. print CSVF "$months[$month] $day, $year $hour:$min:$sec";
  65. print CSVF "\",\"";
  66. print CSVF "$b_first";
  67. print CSVF "\",\"";
  68. print CSVF "$b_last";
  69. print CSVF "\",\"";
  70. print CSVF "$b_addr";
  71. print CSVF "\",\"";
  72. print CSVF "$b_addr2";
  73. print CSVF "\",\"";
  74. print CSVF "$b_city";
  75. print CSVF "\",\"";
  76. print CSVF "$b_state";
  77. print CSVF "\",\"";
  78. print CSVF "$b_zip";
  79. print CSVF "\",\"";
  80. print CSVF "$b_phone";
  81. print CSVF "\",\"";
  82. print CSVF "$b_fax";
  83. print CSVF "\",\"";
  84. print CSVF "$b_email";
  85. print CSVF "\",\"";
  86. print CSVF "$s_first";
  87. print CSVF "\",\"";
  88. print CSVF "$s_last";
  89. print CSVF "\",\"";
  90. print CSVF "$s_addr";
  91. print CSVF "\",\"";
  92. print CSVF "$s_addr2";
  93. print CSVF "\",\"";
  94. print CSVF "$s_city";
  95. print CSVF "\",\"";
  96. print CSVF "$s_state";
  97. print CSVF "\",\"";
  98. print CSVF "$s_zip";
  99. print CSVF "\",\"";
  100. print CSVF "$s_phone";
  101. print CSVF "\",\"";  
  102. print CSVF "$QUANTITY_1";
  103. print CSVF "\",\"";
  104. print CSVF "\$$PRICE_1";
  105. print CSVF "\",\"";
  106. print CSVF "$ID_1";
  107. print CSVF "\",\"";
  108. print CSVF "$NAME_1";
  109. print CSVF "\",\"";
  110. print CSVF "$ADDTLINFO_1";
  111. print CSVF "\",\"";
  112. print CSVF "$QUANTITY_2";
  113. print CSVF "\",\"";
  114. print CSVF "\$$PRICE_2";
  115. print CSVF "\",\"";
  116. print CSVF "$ID_2";
  117. print CSVF "\",\"";
  118. print CSVF "$NAME_2";
  119. print CSVF "\",\"";
  120. print CSVF "$ADDTLINFO_2";
  121. print CSVF "\",\"";
  122. print CSVF "$QUANTITY_3";
  123. print CSVF "\",\"";
  124. print CSVF "\$$PRICE_3";
  125. print CSVF "\",\"";
  126. print CSVF "$ID_3";
  127. print CSVF "\",\"";
  128. print CSVF "$NAME_3";
  129. print CSVF "\",\"";
  130. print CSVF "$ADDTLINFO_3";
  131. print CSVF "\",\"";
  132. print CSVF "$QUANTITY_4";
  133. print CSVF "\",\"";
  134. print CSVF "\$$PRICE_4";
  135. print CSVF "\",\"";
  136. print CSVF "$ID_4";
  137. print CSVF "\",\"";
  138. print CSVF "$NAME_4";
  139. print CSVF "\",\"";
  140. print CSVF "$ADDTLINFO_4";
  141. print CSVF "\",\"";
  142. print CSVF "$QUANTITY_5";
  143. print CSVF "\",\"";
  144. print CSVF "\$$PRICE_5";
  145. print CSVF "\",\"";
  146. print CSVF "$ID_5";
  147. print CSVF "\",\"";
  148. print CSVF "$NAME_5";
  149. print CSVF "\",\"";
  150. print CSVF "$ADDTLINFO_5";
  151. print CSVF "\",\"";
  152. print CSVF "$QUANTITY_6";
  153. print CSVF "\",\"";
  154. print CSVF "\$$PRICE_6";
  155. print CSVF "\",\"";
  156. print CSVF "$ID_6";
  157. print CSVF "\",\"";
  158. print CSVF "$NAME_6";
  159. print CSVF "\",\"";
  160. print CSVF "$ADDTLINFO_6";
  161. print CSVF "\",\"";
  162. print CSVF "$QUANTITY_7";
  163. print CSVF "\",\"";
  164. print CSVF "\$$PRICE_7";
  165. print CSVF "\",\"";
  166. print CSVF "$ID_7";
  167. print CSVF "\",\"";
  168. print CSVF "$NAME_7";
  169. print CSVF "\",\"";
  170. print CSVF "$ADDTLINFO_7";
  171. print CSVF "\",\"";
  172. print CSVF "$QUANTITY_8";
  173. print CSVF "\",\"";
  174. print CSVF "\$$PRICE_8";
  175. print CSVF "\",\"";
  176. print CSVF "$ID_8";
  177. print CSVF "\",\"";
  178. print CSVF "$NAME_8";
  179. print CSVF "\",\"";
  180. print CSVF "$ADDTLINFO_8";
  181. print CSVF "\",\"";
  182. print CSVF "$QUANTITY_9";
  183. print CSVF "\",\"";
  184. print CSVF "\$$PRICE_9";
  185. print CSVF "\",\"";
  186. print CSVF "$ID_9";
  187. print CSVF "\",\"";
  188. print CSVF "$NAME_9";
  189. print CSVF "\",\"";
  190. print CSVF "$ADDTLINFO_9";
  191. print CSVF "\",\"";
  192. print CSVF "$QUANTITY_10";
  193. print CSVF "\",\"";
  194. print CSVF "\$$PRICE_10";
  195. print CSVF "\",\"";
  196. print CSVF "$ID_10";
  197. print CSVF "\",\"";
  198. print CSVF "$NAME_10";
  199. print CSVF "\,\"";
  200. print CSVF "$ADDTLINFO_10";
  201. print CSVF "\",\"";
  202. print CSVF "$QUANTITY_11";
  203. print CSVF "\",\"";
  204. print CSVF "\$$PRICE_11";
  205. print CSVF "\",\"";
  206. print CSVF "$ID_11";
  207. print CSVF "\",\"";
  208. print CSVF "$NAME_11";
  209. print CSVF "\",\"";
  210. print CSVF "$ADDTLINFO_11";
  211. print CSVF "\",\"";
  212. print CSVF "$QUANTITY_12";
  213. print CSVF "\",\"";
  214. print CSVF "\$$PRICE_12";
  215. print CSVF "\",\"";
  216. print CSVF "$ID_12";
  217. print CSF "\",\"";
  218. print CSVF "$NAME_12";
  219. print CSVF "\",\"";
  220. print CSVF "$ADDTLINFO_12";
  221. print CSVF "\",\"";
  222. print CSVF "$QUANTITY_13";
  223. print CSVF "\",\"";
  224. print CSVF "\$$PRICE_13";
  225. print CSVF "\",\"";
  226. print CSVF "$ID_13";
  227. print CSVF "\",\"";
  228. print CSVF "$NAME_13";
  229. print CSVF "\",\"";
  230. print CSVF "$ADDTLINFO_13";
  231. print CSVF "\",\"";
  232. print CSVF "$SUBTOTAL";
  233. print CSVF "\",\"";
  234. print CSVF "$TOTAL";
  235. print CSVF "\",\"";
  236. print CSVF "$SHIPPING";
  237. print CSVF "\",\"";
  238. print CSVF "$comment";
  239. print CSVF "\"\n";
  240. close CSVF;
  241. }
  242. # Send email conformation to the customer.....
  243. open (MAIL,"|$mailprogram");
  244. print MAIL "To: $b_email\n";
  245. print MAIL "From: [email protected]\n";
  246. print MAIL "Subject: Order Confirmation\n";
  247. print MAIL "\n\n";
  248. print MAIL "A new order has been received.  A summary of this order appears below.\n";
  249. print MAIL "\n";
  250. print MAIL "Order Date: $months[$month] $day, $year $hour:$min:$sec \n";
  251. print MAIL " \n";
  252. print MAIL "Bill To: \n";
  253. print MAIL "\n";
  254. print MAIL "  $b_first $b_last \n";
  255. print MAIL "  $b_addr \n";
  256. print MAIL " $b_addr2 \n";
  257. print MAIL "  $b_city, $b_state  $b_zip \n";
  258. print MAIL "  $b_phone \n";
  259. print MAIL "  $b_fax \n";
  260. print MAIL "  $b_email \n";
  261. print MAIL " \n";
  262. print MAIL " \n";
  263. print MAIL "Ship To: \n";
  264. print MAIL "\n";
  265.  
  266. if ( $s_addr eq "" ) {
  267.    print MAIL "   Use Billing Address\n";
  268. } else {
  269. print MAIL "  $s_first $s_last \n";
  270. print MAIL "  $s_addr \n";
  271. print MAIL "  $s_addr2 \n";
  272. print MAIL "  $s_city, $s_state  $s_zip \n";
  273. print MAIL "  $s_phone \n";
  274. }
  275. print MAIL " \n";
  276. print MAIL " \n";
  277. print MAIL "Qty  Price(\$)   Product ID  - Product Name\n";
  278. print MAIL "\n";
  279. print MAIL "$QUANTITY_1    \$$PRICE_1    $ID_1 - $NAME_1   $ADDTLINFO_1  \n";
  280. if( $NAME_2 ) {print MAIL "$QUANTITY_2 \$$PRICE_2  $ID_2 - $NAME_2   $ADDTLINFO_2  \n";}
  281. if( $NAME_3 ) {print MAIL "$QUANTITY_3 \$$PRICE_3  $ID_3 - $NAME_3   $ADDTLINFO_3  \n";}
  282. if( $NAME_4 ) {print MAIL "$QUANTITY_4 \$$PRICE_4  $ID_4 - $NAME_4   $ADDTLINFO_4  \n";}
  283. if( $NAME_5 ) {print MAIL "$QUANTITY_5 \$$PRICE_5  $ID_5 - $NAME_5   $ADDTLINFO_5  \n";}
  284. if( $NAME_6 ) {print MAIL "$QUANTITY_6 \$$PRICE_6  $ID_6 - $NAME_6   $ADDTLINFO_6  \n";}
  285. if( $NAME_7 ) {print MAIL "$QUANTITY_7 \$$PRICE_7  $ID_7 - $NAME_7   $ADDTLINFO_7  \n";}
  286. if( $NAME_8 ) {print MAIL "$QUANTITY_8 \$$PRICE_8  $ID_8 - $NAME_8   $ADDTLINFO_8  \n";}
  287. if( $NAME_9 ) {print MAIL "$QUANTITY_9 \$$PRICE_9  $ID_9 - $NAME_9   $ADDTLINFO_9  \n";}
  288. if( $NAME_10 ){print MAIL "$QUANTITY_10 \$$PRICE_10  $ID_10 - $NAME_10  $ADDTLINFO_10 \n";}
  289. if( $NAME_11 ){print MAIL "$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11   $ADDTLINFO_11 \n";}
  290. if( $NAME_12 ){print MAIL "$QUANTITY_12 \$$PRICE_12  $ID_12 - $NAME_12   $ADDTLINFO_12 \n";}
  291. if( $NAME_13 ){print MAIL "$QUANTITY_13 \$$PRICE_13  $ID_13 - $NAME_13   $ADDTLINFO_13 \n";}
  292. print MAIL "\n";
  293. print MAIL "SUBTOTAL: $SUBTOTAL \n";
  294. print MAIL "TOTAL: $TOTAL \n";
  295. print MAIL "\n";
  296. print MAIL "FREIGHT: $SHIPPING \n";
  297. print MAIL "\n\n";
  298. print MAIL "Comments: \n";
  299. print MAIL "\n";
  300. print MAIL "$comment \n";
  301. print MAIL " \n";
  302. close MAIL;
  303. print "Content-type: text/html\n\n";
  304. open (HEAD, $header);
  305. @LINES = <HEAD>;
  306. close HEAD;
  307. print @LINES;
  308. print "<h2>Thank you</h2>";
  309. print "Thank you for your order from our online store.  You will receive a confirmation email of your order ";
  310. print "momentarily.  Please contact us at $youremail if you have any questions or concerns.";
  311. print "<P>";
  312. print "<A HREF=\"$returnpage\" target=_top>Return Home</A>";
  313. print "<P>";
  314.  
  315. open (FOOT, $footer);
  316. @LINES = <FOOT>;
  317. close FOOT;
  318.  
  319. print @LINES;
  320.