View Full Version : How do i change the Default email header?
kelvinismyname
11-09-2006, 10:10 PM
I am using a form that uses the php mail function to sent the form info...the form sucessfully sends emails but the problem is when the person receives the email.... it comes from
myusername@host37.hostmonster.com how can i change this to say
webmaster@mywebsite.com ?
i saw on the HM helpdesk site that is has to do with the a script on there server that changes the From header if its not format properly....I dont really get it though?
linFox
11-11-2006, 09:40 PM
I'm fairly sure that the correct format for a From header is either:
From: address@example.com
OR
From: name < address@example.com >
It should work if the From header matches one of those.
virtualahmad
11-19-2006, 09:52 PM
this has been a pain for me as well... the FROM address i setup in the script is a valid formatted email address... but still sends as kelvinismyname says.
shadmego
11-19-2006, 10:07 PM
What script are you using? Can you post some/all of the code?
shadmego
11-19-2006, 10:27 PM
I did a quick search in google for issues between SSL and CSS. I found that there is a possibility of SSL reverting to non-standards compliant mode (using non-standard values for padding and other elements). The person reporting this didn't know the cause and was still looking into (in 2001).
Another site I found stated this:
When the SSL Padlock does not show up, or browser reports there are Insecure Item(s) on the Page You have a non- HTTPS link to a file, image, CSS style sheet, JavaScript, Flash, etc.
Here's the Rule when the server delivers a page (or script output) from an HTTPS request.
Any object that could possibly come up under the SSL connection, must have a reference to the secure HTTPS location of that object. This means any image, cart buttons, logos, template images, images for products placed in your cart, etc., will need to be called using the HTTPS Address.
To fix this situation, you'll have to track down just exactly where the non-compliant object is. Something is referenced inside the page (dynamic page if scripted) using the standard HTTP Non Secure URL Address, rather then the HTTPS Secure URL Address.
...
I realize this is dealing with certificate errors, but I found this interesting and thought you might as well. I'm thinking there might be a link between the two issues I've read. You can read the whole article here (http://www.merchantorderform.com/docs/troubleshooting/ssl_issues.htm).
Hope this helps
regards,
Shadmego
kelvinismyname
11-28-2006, 07:09 AM
Well i found the Fix to this problem..it had to do with ? ..ummm darn i forgot what it had to dooo with exactly "return path" i think.........
but anyways in your script that "sends" the mail....you need to format the @mail function like this..
@mail($to,$subj,$contents,$header,"-fmysite@mysite.com");
.................................................. ................................................
The "important" part is that after $header, you need to add add----> "-fadmin@yoursite.com"
"-f" "& your return address"
if you need help let mee know......
shadmego
11-28-2006, 08:14 AM
I apologize for the last post of mine in this thread. I had tried to post it in another thread but it disappeared. I'm glad I know where it went now!
Again. Sorry for the seemingly WAAYYY off-topic post. I don't have a clue how it ended up in this thread.
regards,
Shadmego
_bullseye_
11-30-2006, 01:42 PM
Hope this is related...
I am using a script to send form data with the sendmail function.
This line:
print MAIL "From: ($Config{'email'}) ($Config{'realname'})\n";
is being overridden by placing shopnewh@host29.hostmonster.com in the From field.
How can i force this?
Yeah, I'm also fighting the same issue in PHPlist (there is a thread in the general question area).
xic :confused:
I'm having the same problem.....anyone ever get this figured out?
Thanks!
sjlplat
06-06-2007, 01:44 PM
Hostmonster requires the Envelope-From header to be included. I use the following headers, and it works flawlessly.
From: Sender Name <sender@email.com>
Reply-To: <sender@email.com>
Return-Path: <sender@email.com>
Envelope-from: <sender@email.com>
Content-Type: text/plain; charset=UTF-8
MIME-Version: 1.0
As a side note: I've noticed that if the email address does not exist, it will not be included in the From: field. If you elect to use a No Reply address for sendmail, create the No Reply user, and set a filter for that user to delete all incoming messages.
Thanks for the tips....but I'm still having some problems. Here's a copy of my test code in Perl.
Thanks for any suggestions.
Code:
$sendmail = '/usr/sbin/sendmail';
open(SENDMAIL, "|$sendmail <to_email@domain.com>");
print SENDMAIL <<Mail_Headers;
From: Sender Name <email@domain.com>
Reply-To: <email@domain.com>
Return-Path: <email@domain.com>
Envelope-from: <email@domain.com>
Content-Type: text/text; charset=UTF-8
MIME-Version: 1.0
Mail_Headers
print SENDMAIL qq| test email|;
close (SENDMAIL);
sjlplat
06-06-2007, 03:27 PM
Thanks for the tips....but I'm still having some problems. Here's a copy of my test code in Perl.
Thanks for any suggestions.
Code:
I'm not familiar with Perl formatting. My form mailers are all written in PHP. I'll do some research and see if I can come up with a Perl solution.
This is what I've got:
#!/usr/bin/perl
use CGI;
my $query = new CGI;
my $sendmail = "/usr/sbin/sendmail -t";
my $reply_to = "Reply-to: foo@bar.org\n";
my $env_to = "Envelope-to: foo@bar.org\n";
my $ret_path = "Return-path: foo@bar.org\n";
my $subject = "Subject: Confirmation of your submission\n";
my $content = "Thanks for your submission.";
my $to = $query->param('send_to')."\n";
my $send_to = "To: ".$query->param('send_to');
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $reply_to;
print SENDMAIL $env_to;
print SENDMAIL $ret_path;
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL "Content-type: text/plain; charset=UTF-8\n\n";
print SENDMAIL $content;
close(SENDMAIL);
Thanks so much for the help! It should be real simple....but I'm just having problems. I'm using SendMail on my current server with no problems....but am having 'issues' with HM.
sjlplat
06-06-2007, 03:40 PM
Thanks so much for the help! It should be real simple....but I'm just having problems. I'm using SendMail on my current server with no problems....but am having 'issues' with HM.
Have you tried using the -w switch to generate error logs?
I came across that same perl sendmail routine about the same time you sent it. Still trying to get it to work properly. I'll try the -w switch.
Thanks....let me know if you think of any other idea.
dj.
sjlplat
06-07-2007, 08:48 AM
I came across that same perl sendmail routine about the same time you sent it. Still trying to get it to work properly. I'll try the -w switch.
Thanks....let me know if you think of any other idea.
dj.
I did a little editing, but it's really not my area of expertise. I'm sure you have much more knowledge in that regard. I'll keep my eyes peeled and if you haven't found a solution in a couple days, I'll try writing a script. :)
tiangolo
10-28-2008, 01:13 AM
Hola,
Encontré solución: Crear la cuenta desde la que se quiere enviar.
Tenía el mismo problema con phplist, intentaba enviar correos desde una cuenta de correo que administro con google apps, pero llegaban desde <usuarioHM>@host168.hostmonster.com.
Soporte de Hostmonster me explicó que solo hay que crear una cuenta de correo dentro de HostMonster con el correo desde el cual se quiere enviar. No importa si los registros de MX están dirigidos a otra parte y la cuenta desde la que se quiere enviar no recibirá ningún correo en HostMonster, lo que importa es que la cuenta exista.
Creo que está explicado arriba, pero como administro el correo con google apps pensé que era distinto.
Sebastián.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.