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

aqui la segunda parte del codigo

Código perl:
Ver original
  1. $csvcomments = $comment;
  2. open (CSVF,">>$csvfilename");
  3. print CSVF "\"";
  4. print CSVF "$months[$month] $day, $year $hour:$min:$sec";
  5. print CSVF "\",\"";
  6. print CSVF "$b_first";
  7. print CSVF "\",\"";
  8. print CSVF "$b_last";
  9. print CSVF "\",\"";
  10. print CSVF "$b_addr";
  11. print CSVF "\",\"";
  12. print CSVF "$b_addr2";
  13. print CSVF "\",\"";
  14. print CSVF "$b_city";
  15. print CSVF "\",\"";
  16. print CSVF "$b_state";
  17. print CSVF "\",\"";
  18. print CSVF "$b_zip";
  19. print CSVF "\",\"";
  20. print CSVF "$b_phone";
  21. print CSVF "\",\"";
  22. print CSVF "$b_fax";
  23. print CSVF "\",\"";
  24. print CSVF "$b_email";
  25. print CSVF "\",\"";
  26. print CSVF "$s_first";
  27. print CSVF "\",\"";
  28. print CSVF "$s_last";
  29. print CSVF "\",\"";
  30. print CSVF "$s_addr";
  31. print CSVF "\",\"";
  32. print CSVF "$s_addr2";
  33. print CSVF "\",\"";
  34. print CSVF "$s_city";
  35. print CSVF "\",\"";
  36. print CSVF "$s_state";
  37. print CSVF "\",\"";
  38. print CSVF "$s_zip";
  39. print CSVF "\",\"";
  40. print CSVF "$s_phone";
  41. print CSVF "\",\"";  
  42. print CSVF "$QUANTITY_1";
  43. print CSVF "\",\"";
  44. print CSVF "\$$PRICE_1";
  45. print CSVF "\",\"";
  46. print CSVF "$ID_1";
  47. print CSVF "\",\"";
  48. print CSVF "$NAME_1";
  49. print CSVF "\",\"";
  50. print CSVF "$ADDTLINFO_1";
  51. print CSVF "\",\"";
  52. print CSVF "$QUANTITY_2";
  53. print CSVF "\",\"";
  54. print CSVF "\$$PRICE_2";
  55. print CSVF "\",\"";
  56. print CSVF "$ID_2";
  57. print CSVF "\",\"";
  58. print CSVF "$NAME_2";
  59. print CSVF "\",\"";
  60. print CSVF "$ADDTLINFO_2";
  61. print CSVF "\",\"";
  62. print CSVF "$QUANTITY_3";
  63. print CSVF "\",\"";
  64. print CSVF "\$$PRICE_3";
  65. print CSVF "\",\"";
  66. print CSVF "$ID_3";
  67. print CSVF "\",\"";
  68. print CSVF "$NAME_3";
  69. print CSVF "\",\"";
  70. print CSVF "$ADDTLINFO_3";
  71. print CSVF "\",\"";
  72. print CSVF "$QUANTITY_4";
  73. print CSVF "\",\"";
  74. print CSVF "\$$PRICE_4";
  75. print CSVF "\",\"";
  76. print CSVF "$ID_4";
  77. print CSVF "\",\"";
  78. print CSVF "$NAME_4";
  79. print CSVF "\",\"";
  80. print CSVF "$ADDTLINFO_4";
  81. print CSVF "\",\"";
  82. print CSVF "$QUANTITY_5";
  83. print CSVF "\",\"";
  84. print CSVF "\$$PRICE_5";
  85. print CSVF "\",\"";
  86. print CSVF "$ID_5";
  87. print CSVF "\",\"";
  88. print CSVF "$NAME_5";
  89. print CSVF "\",\"";
  90. print CSVF "$ADDTLINFO_5";
  91. print CSVF "\",\"";
  92. print CSVF "$QUANTITY_6";
  93. print CSVF "\",\"";
  94. print CSVF "\$$PRICE_6";
  95. print CSVF "\",\"";
  96. print CSVF "$ID_6";
  97. print CSVF "\",\"";
  98. print CSVF "$NAME_6";
  99. print CSVF "\",\"";
  100. print CSVF "$ADDTLINFO_6";
  101. print CSVF "\",\"";
  102. print CSVF "$QUANTITY_7";
  103. print CSVF "\",\"";
  104. print CSVF "\$$PRICE_7";
  105. print CSVF "\",\"";
  106. print CSVF "$ID_7";
  107. print CSVF "\",\"";
  108. print CSVF "$NAME_7";
  109. print CSVF "\",\"";
  110. print CSVF "$ADDTLINFO_7";
  111. print CSVF "\",\"";
  112. print CSVF "$QUANTITY_8";
  113. print CSVF "\",\"";
  114. print CSVF "\$$PRICE_8";
  115. print CSVF "\",\"";
  116. print CSVF "$ID_8";
  117. print CSVF "\",\"";
  118. print CSVF "$NAME_8";
  119. print CSVF "\",\"";
  120. print CSVF "$ADDTLINFO_8";
  121. print CSVF "\",\"";
  122. print CSVF "$QUANTITY_9";
  123. print CSVF "\",\"";
  124. print CSVF "\$$PRICE_9";
  125. print CSVF "\",\"";
  126. print CSVF "$ID_9";
  127. print CSVF "\",\"";
  128. print CSVF "$NAME_9";
  129. print CSVF "\",\"";
  130. print CSVF "$ADDTLINFO_9";
  131. print CSVF "\",\"";
  132. print CSVF "$QUANTITY_10";
  133. print CSVF "\",\"";
  134. print CSVF "\$$PRICE_10";
  135. print CSVF "\",\"";
  136. print CSVF "$ID_10";
  137. print CSVF "\",\"";
  138. print CSVF "$NAME_10";
  139. print CSVF "\",\"";
  140. print CSVF "$ADDTLINFO_10";
  141. print CSVF "\",\"";
  142. print CSVF "$QUANTITY_11";
  143. print CSVF "\",\"";
  144. print CSVF "\$$PRICE_11";
  145. print CSVF "\",\"";
  146. print CSVF "$ID_11";
  147. print CSVF "\",\"";
  148. print CSVF "$NAME_11";
  149. print CSVF "\",\"";
  150. print CSVF "$ADDTLINFO_11";
  151. print CSVF "\",\"";
  152. print CSVF "$QUANTITY_12";
  153. print CSVF "\",\"";
  154. print CSVF "\$$PRICE_12";
  155. print CSVF "\",\"";
  156. print CSVF "$ID_12";
  157. print CSVF "\",\"";
  158. print CSVF "$NAME_12";
  159. print CSVF "\",\"";
  160. print CSVF "$ADDTLINFO_12";
  161. print CSVF "\",\"";
  162. print CSVF "$QUANTITY_13";
  163. print CSVF "\",\"";
  164. print CSVF "\$$PRICE_13";
  165. print CSVF "\",\"";
  166. print CSVF "$ID_13";
  167. print CSVF "\",\"";
  168. print CSVF "$NAME_13";
  169. print CSVF "\",\"";
  170. print CSVF "$ADDTLINFO_13";
  171. print CSVF "\",\"";
  172. print CSVF "$SUBTOTAL";
  173. print CSVF "\",\"";
  174. print CSVF "$TOTAL";
  175. print CSVF "\",\"";
  176. print CSVF "$SHIPPING";
  177. print CSVF "\",\"";
  178. print CSVF "$comment";
  179. print CSVF "\"\n";
  180. close CSVF;
  181. }
  182. open (MAIL,"|$mailprogram");
  183. print MAIL "To: $b_email\n";
  184. print MAIL "From: $youremail\n";
  185. print MAIL "Subject: Order Confirmation\n";
  186. print MAIL "\n\n";
  187. print MAIL "A new order has been received.  A summary of this order appears below.\n";
  188. print MAIL "\n";
  189. print MAIL "Order Date: $months[$month] $day, $year $hour:$min:$sec \n";
  190. print MAIL " \n";
  191. print MAIL "Bill To: \n";
  192. print MAIL "-------- \n";
  193. print MAIL "   $b_first $b_last \n";
  194. print MAIL "   $b_addr \n";
  195. print MAIL "   $b_addr2 \n";
  196. print MAIL "   $b_city, $b_state  $b_zip \n";
  197. print MAIL "   $b_phone \n";
  198. print MAIL "   $b_fax \n";
  199. print MAIL "   $b_email \n";
  200. print MAIL " \n";
  201. print MAIL " \n";
  202. print MAIL "Ship To: \n";
  203. print MAIL "-------- \n";
  204.  
  205. if ( $s_addr eq "" ) {
  206.  print MAIL "   Use Billing Address\n";
  207. } else {
  208. print MAIL "   $s_first $s_last \n";
  209. print MAIL "   $s_addr \n";
  210. print MAIL "   $s_addr2 \n";
  211. print MAIL "   $s_city, $s_state  $s_zip \n";
  212. print MAIL "   $s_phone \n";
  213. }
  214.  
  215. print MAIL " \n";
  216. print MAIL " \n";
  217. print MAIL "Qty  Price(\$)   Product ID  - Product Name\n";
  218. print MAIL "\n";
  219. print MAIL "$QUANTITY_1    \$$PRICE_1    $ID_1 - $NAME_1   $ADDTLINFO_1  \n";
  220. if( $NAME_2 ) {print MAIL "$QUANTITY_2    \$$PRICE_2    $ID_2 - $NAME_2   $ADDTLINFO_2  \n";}
  221. if( $NAME_3 ) {print MAIL "$QUANTITY_3    \$$PRICE_3    $ID_3 - $NAME_3   $ADDTLINFO_3  \n";}
  222. if( $NAME_4 ) {print MAIL "$QUANTITY_4    \$$PRICE_4    $ID_4 - $NAME_4   $ADDTLINFO_4  \n";}
  223. if( $NAME_5 ) {print MAIL "$QUANTITY_5    \$$PRICE_5    $ID_5 - $NAME_5   $ADDTLINFO_5  \n";}
  224. if( $NAME_6 ) {print MAIL "$QUANTITY_6    \$$PRICE_6    $ID_6 - $NAME_6   $ADDTLINFO_6  \n";}
  225. if( $NAME_7 ) {print MAIL "$QUANTITY_7    \$$PRICE_7    $ID_7 - $NAME_7   $ADDTLINFO_7  \n";}
  226. if( $NAME_8 ) {print MAIL "$QUANTITY_8    \$$PRICE_8    $ID_8 - $NAME_8   $ADDTLINFO_8  \n";}
  227. if( $NAME_9 ) {print MAIL "$QUANTITY_9    \$$PRICE_9    $ID_9 - $NAME_9   $ADDTLINFO_9  \n";}
  228. if( $NAME_10 ){print MAIL "$QUANTITY_10    \$$PRICE_10    $ID_10 - $NAME_10   $ADDTLINFO_10 \n";}
  229. if( $NAME_11 ){print MAIL "$QUANTITY_11    \$$PRICE_11    $ID_11 - $NAME_11   $ADDTLINFO_11 \n";}
  230. if( $NAME_12 ){print MAIL "$QUANTITY_12    \$$PRICE_12    $ID_12 - $NAME_12   $ADDTLINFO_12 \n";}
  231. if( $NAME_13 ){print MAIL "$QUANTITY_13    \$$PRICE_13    $ID_13 - $NAME_13   $ADDTLINFO_13 \n";}
  232. print MAIL "\n";
  233. print MAIL "SUBTOTAL: $SUBTOTAL \n";
  234. print MAIL "TOTAL: $TOTAL \n";
  235. print MAIL "\n";
  236. print MAIL "FREIGHT: $SHIPPING \n";
  237. print MAIL "\n\n";
  238. print MAIL "Comments: \n";
  239. print MAIL "\n";
  240. print MAIL "$comment \n";
  241. print MAIL " \n";
  242. close MAIL;
  243. print "Content-type: text/html\n\n";
  244.  
  245. open (HEAD, $header);
  246. @LINES = <HEAD>;
  247. close HEAD;
  248. print @LINES;
  249.  
  250. print "<h2>GRACIAS</h2>";
  251. print "Gracia por su compra";
  252. print "puede ponerse en contacto con nosotros.";
  253. print "<P>";
  254. print "<A HREF=\"$returnpage\" target=_top>Return Home</A>";
  255. print "<P>";
  256.  
  257. open (FOOT, $footer);
  258. @LINES = <FOOT>;
  259. close FOOT;
  260.  
  261. print @LINES;
  262.