![]() |
|
|
#1 (permalink) |
|
Registered User
Join Date: Mar 2006
Posts: 9
|
Sending emails via a contact form
I've got a couple of Hosting accounts on catalyst2 ones a Linux one that I use for php and the others .Net.
On both websites there's a contact us form. For the php one I send the email like so..... mail( "$reciever", $subject,"$enquiry \n\nFrom: $name", "From: $from" ); Now here the $from is the email address that the user enters on the contact form so when I receive the email at my end their email address is in the from field. So to reply in outlook I just click reply and away I go. Now in my .net account it seems I can't do this. If I try and place the users email address that they enter on the contact form into the mail.From variable and send the email it will fail to send and return an error reading. "Error message:Mailbox unavailable. The server response was: No MX for envelope sender domain whatever.com. Stack Trace: at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message)" This means in order to get it working i've got to setup a forwarding email address, say contacts@whatever.co.uk which I then set as the mail.from variable then added the proper users 'from' email address as a link in the email message and tell the person that if they want to reply to click the link. is there any way I can make the .net version work the same as the php version or is it just some stupid security these been implemented on the .net accounts that only let you send from recognised email addresses? Another thing i've noticed is that with the php account when I click send on the contact form it sends within 2 seconds probably less. With the .Net one it takes a good 30 seconds or more. At first I thought it was down to it caching the .net code on first load but after running the form a few times it takes nearly as long each time. Not doing anything special at the back end that would account for the long pause and if it continues i'm going to have to use some kind of javascript to let the user know that things are still happening as there going to think its got stuck and keep repressing the send button as it takes so long. Last edited by agentwalker; 16-02-2008 at 01:34 PM. |
|
|
|
|
|
#2 (permalink) |
|
Administrator
Join Date: Oct 2003
Posts: 1,484
|
.net perf issue - I've just tested one of my .net email forms on catalyst2's servers and have not noticed such an issue. If you'd like to PM or raise a ticket I can look into it further.
If my understanding of the mail security is correct (I'm sure Paul will correct me if not) then the sender or the recipient of the email has to be one of the domains hosted by Catalyst2. This is done so that Catalyst2's email servers are not open relays for any spammer to use. Again if my understanding of this is correct the reason this is not the case on linux servers is because they have a slightly different setup where there is a check done to make sure the email originated from the same server.
__________________
Jason Robbins jason@catalyst2.com |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|