Page 1 of 1
mail from one mail server to other mail server
Posted: Fri Mar 26, 2004 5:20 am
by softsolvers
Hello friends
I want to send mail from from one mail server to other:
for example
from
aaa@yahoo.com to
aaa@rediffmail.com.
if i am using the default setting of php.ini and write the mail function i am not able to do this can anybody helps me that how can i do this.
Posted: Fri Mar 26, 2004 5:25 am
by seeker2921
What is the code that you are using?
Posted: Fri Mar 26, 2004 5:29 am
by softsolvers
thanks
i am using the simple code
<?php
mail("
aaa@rediffmail.com","testing","test");
?>
and in php.ini file i had changed the sendmail_from :
aaa@yahoo.com and rest settings are default
Posted: Fri Mar 26, 2004 5:38 am
by seeker2921
I just tosed this together It should work but I havn't tested it..
Code: Select all
<?
$mailto = "aaa@rediffmail.com"; //email you are sending to
$email ="aaa@yahoo.com"; //From email
$message = "Test"; //message body
$subject = "Testing"; //Subject line
$msg = ereg_replace("\\''", "'", $message);
$msg = ereg_replace('"', """, $msg);
$message1 = "From: $name\nemail: $email\nmessage:\n$msg1";
mail($mailto, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");
?>
on your code you didn't add "From: $email\r\nReply-to: $email\r\n" that to it so you could also do it this way
Code: Select all
<?
mail("aaa@rediffmail.com", "testing", "test", "From: aaa@rediffmail.com\r\nReply-to: aaa@rediffmail.com\r\n");
?>