dongli564510 2015-04-10 10:00
浏览 135

如何使用php自行发送带有XAMPP-Mercury Mail的电子邮件

I've been searching a lot, but can't really find what i exactly need.

Im running a shop-online using XAMPP, and what i want is send emails to the customers with their order but using a specific function.

What this fuction does, is to hide some characters (for security purpose) on the email sent to customers. So i've made the function (looking on internet), but i want to test it now.

This is my function (if it's wrong, i'd really appreciate some help):

<?php
 function xtc_hide_iban ($iban) {

$length = strlen($iban);
$lchars = substr($iban,0 ,5);
$rchars = substr($iban, -5);
$iban_hidden = $lchars.str_repeat('*',$length-10).$rchars;
return $iban_hidden;

}
?>

I think it's pretty obvious what i try to do, but i will still explain it:

Get the $iban from customers, and show only the first and last 5 characters when the email is sent e.G

Your IBAN is 'DE123************56789'

So, for now i can send emails from Mercury mail server to 'root@localhost',account i made on thunderbird, (it's the only account that worked for me, because any other with the same server, like 'anyname@localhost' didn't work or couldn't be created, and those who were create with imap before couldn't access to the inbox "could not connected to server, connection refuse", anyway this works with POP3)

Following what i looked before, is that somehow and somewhere i can put a *.php on Mercury folder so i will get a template of how to send the mails (headers, subject,body,etc).

My main question is how and where to do that? make a test php file to make sure my code is doing what i want to do

Thanks in advance

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 c语言,请帮蒟蒻看一个题
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)