3 Replies - 6359 Views - Last Post: 08 June 2009 - 01:16 AM Rate Topic: -----

#1 peihwa330  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 15-March 07

send email from localhost to other email accounts

Posted 07 June 2009 - 09:21 PM

hi there,
I'm trying to create a function to send email from localhost(postmaster@localhost) to other email accounts(ymail,gmail,hotmail).I'm currently using xampp and the mercury32 inside xampp.I had successfully sent email from localhost to localhost but I can't make it to send outside from localhost. This is the code and it works perfectly sending email from localhost to localhost.
<?php

//Check whether the submission is made
if(isset($_POST['Submit'])){

//Declarate the necessary variables
$mail_to=$txtEmailto2;
$mail_from=$txtEmailfrm2;
$mail_sub=$txtSub2;
$mail_mesg=$txtMsg;

//Check for success/failure of delivery
if(mail($mail_to,$mail_sub,$mail_mesg,"From:$mail_from/r/nReply-to:$mail_from"))
echo "<span class='red'>E-mail has been sent successfully from $mail_to to $mail_from</span>";
else
echo "<span class='red'>Failed to send the E-mail from $mail_to to $mail_from</span>";
}
?>
<html>
<body>
<form name="frmsendmail" method="post" action="" onsubmit="return ValidationForm()">
	  <table width="100%"  border="0">
		<tr>
		 <td width="33%" align="right" class="text">To : 
		  <td width="67%"><input name="txtEmailto2" type="text" class="input" id="txtEmailto22" size="30" maxlength="100">
		</tr>
		<tr>
		  <td align="right" class="text">From : 
		  <td><input name="txtEmailfrm2" type="text" class="input" id="txtEmailfrm22" size="30" maxlength="100">
		</tr>
		<tr>
		  <td align="right" class="text">Subject : 
		<td><input name="txtSub2" type="text" class="input" id="txtSub22" size="30" maxlength="100">
		</tr>
		<tr>
		  <td align="right" class="text">Mesage(body) : 
		 <td><textarea name="txtMsg" cols="50" rows="10" class="input" id="textarea"></textarea>
		</tr>
	  <tr>
		  <td align="right"><input name="hidSubmit" type="hidden" id="hidSubmit" value="true">
			  <input name="Submit" type="submit" class="input" value="Send">
		  <td><input name="Submit2" type="reset" class="input" value="Reset">
		</tr>		 
	  </table>
	 </form>
				
</body>
</html>


Is it possible using mercury32 can send email from localhost to other email accounts?

Is This A Good Question/Topic? 0
  • +

Replies To: send email from localhost to other email accounts

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2934
  • View blog
  • Posts: 10,147
  • Joined: 08-August 08

Re: send email from localhost to other email accounts

Posted 08 June 2009 - 12:11 AM

Your ISP is probably blocking you because this is a frequently used tactic by spammers.
You might be able to get around it using this link:
http://www.howtoforg...ther_mailserver
Was This Post Helpful? 0
  • +
  • -

#3 peihwa330  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 15-March 07

Re: send email from localhost to other email accounts

Posted 08 June 2009 - 12:54 AM

I am very new in programming world and also network stuff. I had no idea how to run the postfix and i did not know I had the postfix installed on my pc or not. Could you help me out? I'll appreaciate it very much. Thanks a lot.
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2934
  • View blog
  • Posts: 10,147
  • Joined: 08-August 08

Re: send email from localhost to other email accounts

Posted 08 June 2009 - 01:16 AM

Sorry, Windows gives me hives. Maybe somebody else can help you with this. It isn't really a PHP problem though, since you can send mail through localhost.

You might try posting a question about Windows mail in this forum:
http://www.dreaminco...showforum25.htm
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1