Sending EMAIL

General discussions related to php

Moderators: macek, egami, gesf

Gamers
New php-forum User
New php-forum User
Posts: 48
Joined: Mon Jun 11, 2012 9:13 am

Sending EMAIL

Postby Gamers » Tue Dec 03, 2013 12:10 pm

Hi All,

I tried to make a PHP script which used to send the mails to all the clients for the i thought first to make a dummy scirpt, But its fail during sending the mail. Below is a error message

Warning: mail(): SMTP server response: 530 5.7.1 Client was not authenticated in C:\inetpub\wwwroot\dummy\email\email_script.php on line 10

I don't know what authentication its need. Please help me to overcome from this problem.

Below is my php script

Code: Select all

<?php

$from="testturnover@abc.com";
$email=$_POST['email'];
$subject=$_POST['subject'];

$message=$_POST['message'];


mail($email, $subject, $message,"From:".$from);

print "email has been sent : </br> $email</br>$subject</br>$message</br>";
?>


Is this warning appear because of wrong SMTP server address ?

peterachutha
New php-forum User
New php-forum User
Posts: 10
Joined: Sat May 31, 2014 10:35 pm

Re: Sending EMAIL

Postby peterachutha » Sat May 31, 2014 11:40 pm

PHP Mail fuction will only send mail out from your website mail box. If your website is http://www.abc.com then sending from email address testturnover@abc.com will work. If you are try to send from testturnover@xyz.com most if not all hosts will block out going mail whose 'from' email address is not in the website's mailbox.

It looks like your testturnover@abc.com may not be located on your website but on another SMTP server. If it is located on an SMTP server you cannot use PHP Mail functions to send through that server. This is the reason I suspect you received the authentication errors as you had not sent the username (the email address) and the password to the SMTP server.

Hope this helps.


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron