Jump to content

sending mail


newbienewbie

Recommended Posts

<html>
<head>
<title>Form Reader</title>
</head>
<body>

<?php
$to      = 'a@yahoo.com';
$subjectmail() = 'the subject';
$message = 'hello';
$headers = 'From: a@yahoo.com' . "\r\n" .
    'Reply-To: a@yahoo.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>
</body>
</html>

 

Tell this newbie , why above program doesn't sends mail?

 

 

Link to comment
Share on other sites

<?php
$to      = 'a@yahoo.com';
$subjectmail() = 'the subject';
$message = 'hello';
$headers = 'From: a@yahoo.com' . "\r\n" .
    'Reply-To: a@yahoo.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

 

try removing the HTML

 

monk.e.boy

Link to comment
Share on other sites

on my live server, just 2line code is working fine

 

<?php
mail('xyz@yahoo.com', 'Test Subject', 'Test Message');
echo "Mail Sent";
?>

 

but it is not working on local server. what sshld i do troubleshoot local server. other php code on local server is wrking fine.

Link to comment
Share on other sites

getting following errro in apache

 

SMTP server response: 550 5.7.1 Unable to relay for xyz@yahoo.com in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\testing\\mail.php on line 11

 

[mail function]
; For Win32 only.
;SMTP = localhost
SMTP=localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com
sendmail_from = webmaster@example.com

tried with smtp.myrealdomain.com also 

Link to comment
Share on other sites

i have the same problem....

this is my code:

 

$to = $_POST['Email'];

$subject = "Welcome";

$body = "<p>Bem Vindo</p>

<p>Vimos por este mail informar que a sua activação da conta está completa.</p>";

$headers = 'From: psike_89@hotmail.com' . "\r\n" .

    'Reply-To: psike_89@hotmail.com' . "\r\n" .

    'X-Mailer: PHP/' . phpversion();

.....

if (mail($to, $subject, $body, $headers)) {

  echo("<p>Email enviado!</p>");

 

 

 

 

 

in my php.ini i change to this way:

 

[mail function]

; For Win32 only.

SMTP = smtp.myrealdomain.com

smtp_port = 25

 

; For Win32 only.

sendmail_from = a@a.pt

 

 

plz help me

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.