开发者

Emailing a comment to an email address stored in a table

In a comment system, I am using variables called $comment and $submittor. I am using a MySQL table called "login" that contains fields called "username" and "email."

The field "email" is an email address.

I would like to send an email with $comment in it to the "email" where "username" = "$submittor."

Here is what I have so far:

$queryem = sprintf('SELECT email FROM login WHERE username = $submittor');

How can I send the email?

Thank开发者_Python百科s in advance,

John


Better use PHPMailer library - it comes with freat tutorial based on GMail SMTP server:

http://phpmailer.worxware.com/index.php?pg=exampleagmail


Use PHP's mail function:

mail($email, 'New comment!', $comment);

(More on emailing with PHP)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜