473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Contact Us page

nomad
664 Expert 512MB
Hello everyone:
I have a question about php script.
When a user fills out a small contact us page and we receive it from G-mail and we open the e-mail. In the header section we get James.Smith@netsolhost.com
is there away to get rid of @netsolhost.com and just have his name. We have your hosting service with netsolutions.


Here is my script
Expand|Select|Wrap|Line Numbers
  1. <?
  2.  
  3. if(isset($_POST['email'])) {
  4.  
  5.     $email_to = "dwong@lightlaboratory.com" ;
  6.     $from = $_POST["Your_name"];
  7.     $email_subject = "Web Support Inquiry";   
  8.  
  9.     if(!isset($_POST['comments']) ||
  10.         !isset($_POST['Your_name']) ||
  11.         !isset($_POST['email'])) //{
  12.         died('We are sorry, but there appears to be a problem with the form you submitted.');      
  13.    // }
  14.  
  15.   $comments = $_POST['comments']; 
  16.   $Your_name = $_POST['Your_name']; 
  17.   $email = $_POST['email']; 
  18.  
  19.     $email_message = "Web Support Inquiry.\n\n";
  20.  
  21.     function clean_string($string) {
  22.       $bad = array("content-type","bcc:","to:","cc:","href");
  23.       return str_replace($bad,"",$string);
  24.     }
  25.     $email_message .= "Comments:    ".clean_string($comments)."\n";
  26.     $email_message .= "Name:    ".clean_string($Your_name)."\n";
  27.     $email_message .= "Email:      ".clean_string($email)."\n";
  28.  
  29. $headers = 'From: '.$Your_name."\r\n".
  30.  
  31. 'Reply-To: '.$email_from."\r\n" .
  32. 'X-Mailer: PHP/' . phpversion();
  33.  
  34. @mail($email_to, $email_subject, $email_message, $headers); 
  35.   header( 'Location: http://www.abc/thank_you.html' ) ;
  36. ?>
  37.  
Please see attached file for a better understanding.
Any help would be great.
_damon
Attached Images
File Type: jpg emial.jpg (21.9 KB, 97 views)
Nov 13 '14 #1
7 1810
Dormilich
8,658 Expert Mod 8TB
In the header section we get James.Smith@netsolhost.com
is there away to get rid of @netsolhost.com and just have his name.
is this the requestor address? what if the address does not contain a meaningful name?
Nov 17 '14 #2
nomad
664 Expert 512MB
Hello Dormilich:
If I don't add a header then I get a bunch of numbers with @netsolhost.com

Any ideals?
_damon
Nov 17 '14 #3
Dormilich
8,658 Expert Mod 8TB
Any ideals?
quite some, but that would be off topic. ;)

If I don't add a header then I get a bunch of numbers with @netsolhost.com
question: where does this email address come from?
Nov 17 '14 #4
nomad
664 Expert 512MB
From your website, hosting site is netsolutions
which then goto to your g-mail account.

_damon
Nov 17 '14 #5
Dormilich
8,658 Expert Mod 8TB
that doesn’t answer the question.

fact remains that you have to use an email address in any case. and since you don’t have any post-processing (after the email was send) you have to live with what gmail offers you.
Nov 18 '14 #6
nomad
664 Expert 512MB
Dormilich:
Is there away round this?
_damon
Nov 18 '14 #7
Dormilich
8,658 Expert Mod 8TB
you could try John Smith <John.Smith@netsolhost.com> (IIRC).

mailing libraries like SwiftMailer make it easy to pass name and email.
Nov 19 '14 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Kerberos | last post by:
Is there a way to change the color of a link in a navbar if the address of the link is the current page? For instance if I have: Home - index.php Products - products.php Contact - contact.php...
1
by: paolazi | last post by:
HI I have a flash templates..that uses php as well now I have a problem with my contact page as follows: the user enter his name, email and message into flash input whose Var are: your_name,...
3
by: John | last post by:
What is the easiest way to make the contact form show on the front page. Meaning on want to keep the front html page and when someone clicks on the contact us link the front page remains the same,...
0
by: kammaldeep | last post by:
hi, i m newbie 2 PHP & to b frank ... will alwaz be ... i dont think i will go into much details with PHP as my work doesnot include workin with PHP bt i have a forum .. and i want to make a...
2
by: kyllle | last post by:
Ok so Iv created a web site that consists of sliding navigation, basically there are 7 buttons on the page and when each one is selected the appropriate page slides over, one of the buttons I have is...
2
by: staryeyes47 | last post by:
Hi, I am creating a contact page for a my website and I am having a bit of trouble. I have created the form in flash, and am using a php file to send the email to myself. The form works OK, but...
12
by: =?Utf-8?B?ZGdvdw==?= | last post by:
I designed a "contact_us" page in visual web developer 2005 express along with EW2 after viewing tutorials on asp.net's help page. Features work like they should, but I cannot figure out how to...
1
by: anu b | last post by:
i have two aspx pages ..i need to add one aspx page under a div tag of another.. i am not able to use iframe for that..then how can i get that...if u guyshave any idea..pls help me.. it is...
3
by: xlr8u2 | last post by:
hi all i have been trying and trying to set up a contact page on godaddy. they require that i use a php script here is their example. <form action="/gdform.php" runat="server" method="post"> ...
1
by: idoru17 | last post by:
Hi, I need to set some parameters in an HTML page displayed in a lightbox (fancybox) using an iframe. The calling page is in HTML, here are the parameters to be set: - 2 text areas named champ1...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.