English 中文(简体)
php email and smtp [duplicate]
原标题:php email and smtp [duplicate]
  • 时间:2011-10-01 11:20:22
  •  标签:
  • php
  • smtp

i ve got a php function which sents emailsvy, but I would it to use the smtp services i have specified ini.set function.

如果删除这三条编码线,则电子邮件仍有罚款。

想使用冲积机的原因是,有时这并不适用于某些邮件接收处。

connect();

    $username = mysql_real_escape_string($_POST[ username ]);

    $result = mysql_query("SELECT email FROM members WHERE username =  $_POST[username] ")
                or die ("Error - Something went wrong.");

    $row = mysql_fetch_array($result);
    $useremail = $row[ email ];

    $name = "name";
    $mail_from = "noreply@name.com";
    $mail_to = "$useremail";
    $mail_body = "Hello. Thank you for registering. Please click the link below to confirm your email address. ";
    $mail_subject = "Confirm you registration".$name;

    $mail_header = "From: ".$name." <".$mail_from.">
";

    ini_set ("SMTP", "ssl://serveraddress");
    ini_set("smtp_port","465");
    ini_set("sendmail_from","noreply@name.com");

    $sendmail = mail($mail_to, $mail_subject, $mail_body, $mail_header);

    if($sendmail == true) { mail("john@name.com", "email sent ok", "email sent to  $_POST[email] ", "yea sent ok");}
    Else { mail("john@name.com", "email ERROR", "email not sent to  $_POST[email] ", "yea we got a problem");}

}
最佳回答

如果你真心想在你的网络应用中寄送大众邮件,即参观迅速的邮资图书馆,其自由而相对容易建立,你可以安排自己的员工和管理当局协调会运输员。

与此相比,在电子邮件使用“邮件”功能之前,我曾有寄给热邮件和ya的问题。 牢记网络电子邮件客户对头盔、结构和安全非常了解,可能拒绝真实客户不作书面的电子邮件。

如果你想要测试像这样的东西,仅仅使用当地解决的@your-domain email,这通常不会过滤。 现在,如果邮件收发,你会知道其他东西。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签