Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
use my own email server and email in php?
Old 07-14-2011, 12:09 PM use my own email server and email in php?
Average Talker

Posts: 17
Name: Ali Shan
Location: Pakistan, Lahore
Trades: 0
Hey everyone!
I am trying to send email from my site with php it's is working but i want use my email noreply@mysite.com but it is not working please help me.
i am using this code
PHP Code:
<?php
    
if (isset($_POST["submit"]))
    {
        include(
"data.php");
        
$Name=$_POST['Name'];
        
$E_Mail=$_POST['E_Mail'];
        
$Ph=$_POST['Ph'];
        
$Ga=$_POST['Ga'];
        
$Comments=$_POST['Comments'];
        
$head=false;
        
// E_val
        
$M_er false;
        
// Ph_val
        
$P_er false;
        
//Check
        
$error true;
        
//Msg
        
$sub "No reply";
        
$msg "$Name Thank you for our feed back.";
        if (
$Name == '' || $E_Mail == '' || $Ph == '' || $Comments == '')
            { 
                echo 
'<div id="container"><div style="position:absolute;left:500px;top:237px;width:768px;height:23px;z-index:10" align="left">Write your name.</div><div style="position:absolute;left:540px;top:335px;width:768px;height:23px;z-index:10" align="left">Your comments Please!</div></div>';
            }
        
        if(
preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/"$E_Mail)) {
            
$M_er false;
        }
        else{
            
$M_er true;
            echo 
'<div id="container"><div style="position:absolute;left:500px;top:263px;width:768px;height:23px;z-index:10" align="left">Invalid Email address.</div></div>';
        }
        
        if(
preg_match("/^[+]{1}[0-9]{12}$/"$Ph)) {
            
$P_er false;
        }
        else{
            
$P_er true;
            echo 
'<div id="container"><div style="position:absolute;left:500px;top:287px;width:768px;height:23px;z-index:10" align="left">Check format (+011231231234).</div></div>';
        }
        if(
$M_er == false && $P_er == false){
            
$error false;
        }
        if(
$error == false){
            
            
mysql_query("INSERT INTO `gmifamil_form`.`gmi` (Name, EMail, Ph, Ga, Comments) VALUES ('$Name', '$E_Mail', '$Ph', '$Ga', '$Comments')")
            or die(
mysql_error());
            
ini_set('SMTP'"mail.mysite.com");
            
ini_set('smtp_port''26');
            
ini_set('sendmail_from'"noreply@mysite.com");
            
mail($E_Mail,$sub,$msg);
            
header("Location: Thank_you.htm");
            }
    }
?>
Regards.
DezineGenerators is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-14-2011, 01:22 PM Re: use my own email server and email in php?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
php.ini set mail server
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to use my own email server and email in php?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16543 seconds with 12 queries