Our client wants to receive mail from the contact form but we can't use his mail. So what I did was make a new mailuser for the site that will stand in the web.config file, receive the mail and make the mailuser I created automaticly forward the mail to our clients mail.
When I send from the form to the mailuser it's getting deleted each time. I think this is because some anti spam mailservers got.(i'll try to explain it the best I can) When I choose the sender in the contact form, let's say [email protected], the mailserver will notice that it's not really [email protected] that is sending the mail, but the mailuser I've created. What happens now is that the mailserver thinks someone are sending mail with a fake mailuser and therefore automaticly deletes the mail.
One solution I think is to remove the email from the contact form and let it come in normal text, then the client will see that the mail is from the mailuser i've created, but the e-mail from his clients will still stand in cleartext inside the mail.
My programming skills aren't the best, so I am not quite sure where to edit this.
if (_contactName.Text == string.Empty)
mail.From = new MailAddress(HttpUtility.HtmlEncode(_contactEmail.Text));
else
mail.From = new MailAddress(HttpUtility.HtmlEncode(_contactEmail.Text), HttpUtility.HtmlEncode(_contactName.Text));
You could easily modify that to use a static e-mail address, just replace the whole bit with:
I guess the .dll file can be decompiled using Reflector http://www.red-gate.com/products/reflector/ - But I think that's a bit cumbersome, since the source code for the package is available on Codeplex, which is being linked from the package site.
Ok. Thanks for that tip. I've now downloaded the source code there and have attempted to alter some of the .aspx.cs code just to test, but it looks like it is not being referenced or looked at when running.
1. Is it possible for me to "unlink" it from the package site in order make it to look at my newly altered file instead?
2. Would I need to recompile the altered code (somehow) to create a new .dll?
If you have opened the project an altered the code you should build your solution - it compiles/updates the .dll file, which you can the upload into the bin folder and overwrite the exiting one.
If you have made changes to the usercontrol (ascx) it should be uploaded into the usercontrols folder as well.
Thanks for your ideas. It sounded so easy. I have done as you have suggested.Using MS C#2008 Express. No luck yet.
1. ) When I rerun the updated macro I receive the following error in the tracestack:
Error creating usercontrol (/usercontrols/CultivContactForm.ascx) The type
'CultivContactForm.CultivContactForm' is ambiguous: it could come from assembly
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\root\85f608c1\7ae2fc52\App_Code.nmfedzwl.DLL' or from assembly
'C:\inetpub\wwwroot\build\bin\CultivContactForm.DLL'. Please specify the
assembly explicitly in the type name.
2) I have gone through countless forums in order to resolve this. It appears that during the building of the project there is a temporary reference to a similar DLL file in the ..\Framework\.. location. Even if I rename the conflicting file, the error still appears. I have tried renaming the type to CultivContactFormTest.CultivContactForm in both the .ascx.designer.cs and the .ascx.cs without any luck (as this is what I'm working on here.... being a newbie).
3) Some forums have suggested deleting the Inherits="CultivContactForm.CultivContactForm" from the <% ... %> area in CultivContactForm.ascx file.
None of these things have worked for me.
I simply want to add a dropdownlist with REASONS FOR YOUR ENQUIRY being listed, the selection to be included automatically in their email as I had done via php outside of umbraco.
Any ideas please? (perhaps even pointing me in the direction of already clear wiki/forum on "how to extend .net macros"
Yes to both the first 2 questions. I have followed the process below with the original code downloaded from Codeplex, and also after editing in my own code, with identical result.
I HAVE NOW GOT IT WORKING without CultivContactForm.dll from the \bin folder, but I don't know how it will work on a Live server due to step 9.
This is my process:
1) In MS C# 2008 Express I dragged the CultivContactForm.ascx, CultivContactForm.ascx.cs and CultivContactForm.ascx.designer.cs into a new project called CultivContactForm using the Class Library template..
2) Then I Add Reference to Recaptcha.dll, umbraco.dll, System.Web.dll v2.05 (v4.0 has '!' beside it for some reason) as expected in "using" section at the top of the .ascx.cs file.
(I have selected .Net Framework V4.0 and Integrated in the application pool in IIS - is this a possible conflict?)
3) I then add the DropDownList to the .ascx, .ascx.designer.cs, and the .ascx.cs files.
4) Save and Build Project.
5) Copy CultivContactForm.dll to \build\bin folder.
CultivContactForm.ascx to \usercontrols folder.
CultivContactForm.ascx.cs and CultivContactForm.ascx.designer.cs to \App_Code folder.
6) Create macro called CultivContactForm and select my .ascx as the .NET User Control file.
7) Add macro to my template.
8) Browse to page and hey presto... the Error: Error creating usercontrol (usercontrols/CultivContactForm.ascx) The type
'CultivContactForm.CultivContactForm' is ambiguous: it could come from assembly
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\root\85f608c1\7ae2fc52\App_Code.yqdfgqks.DLL' or from assembly
'C:\inetpub\wwwroot\build\bin\CultivContactForm.DLL'. Please specify the
assembly explicitly in the type name.
(occasionally this error is in the tracestack also: Master template is the same as the current template. It would course an endless
loop!)
9) When I delete the new CultivContactForm.dll from the \bin folder the ambiguity apparently disappears, and IT WORKS!
So according to the error I need to "specify the
assembly explicitly in the type name". How is this done?
I hope this makes it easy to 'guess' where I may be going wrong.
I now have it working on the test environment: without the .ascx.designer.cs, and the .ascx.cs files in the \App_Code folder AND with the .dll file in the \bin folder.
Mail not being received - Cultiv Contact Form
Hello!
Our client wants to receive mail from the contact form but we can't use his mail.
So what I did was make a new mailuser for the site that will stand in the web.config file, receive the mail and make the mailuser I created automaticly forward the mail to our clients mail.
When I send from the form to the mailuser it's getting deleted each time. I think this is because some anti spam mailservers got.(i'll try to explain it the best I can)
When I choose the sender in the contact form, let's say [email protected], the mailserver will notice that it's not really [email protected] that is sending the mail, but the mailuser I've created.
What happens now is that the mailserver thinks someone are sending mail with a fake mailuser and therefore automaticly deletes the mail.
One solution I think is to remove the email from the contact form and let it come in normal text, then the client will see that the mail is from the mailuser i've created, but the e-mail from his clients will still stand in cleartext inside the mail.
My programming skills aren't the best, so I am not quite sure where to edit this.
So do you think you can help me out a little? :)
Regards,
Fredrik
This is the code that sets the "from" address:
You could easily modify that to use a static e-mail address, just replace the whole bit with:
The e-mail address is already shown in plain text at the bottom of the e-mail.
Sorry for asking really stupid now, but I can't find where the code you just pasted is. = /
Found it in the .dll file now. Will mark as solved if I figure it out. Thanks for input :)
*
Fredrik
I apologise for a possibly ignorant question, but how do I access the .dll file and see the code segment?
It's mostly garbled to me, and I am not aware of a .dll 'reader/editor' to look inside.
Cheers, Adam
Hi Adam
I guess the .dll file can be decompiled using Reflector http://www.red-gate.com/products/reflector/ - But I think that's a bit cumbersome, since the source code for the package is available on Codeplex, which is being linked from the package site.
/Jan
Ok. Thanks for that tip. I've now downloaded the source code there and have attempted to alter some of the .aspx.cs code just to test, but it looks like it is not being referenced or looked at when running.
1. Is it possible for me to "unlink" it from the package site in order make it to look at my newly altered file instead?
2. Would I need to recompile the altered code (somehow) to create a new .dll?
Adam
Hi Adam
If you have opened the project an altered the code you should build your solution - it compiles/updates the .dll file, which you can the upload into the bin folder and overwrite the exiting one.
If you have made changes to the usercontrol (ascx) it should be uploaded into the usercontrols folder as well.
/Jan
Hi Jan,
Thanks for your ideas. It sounded so easy. I have done as you have suggested.Using MS C#2008 Express. No luck yet.
1. ) When I rerun the updated macro I receive the following error in the tracestack:
Error creating usercontrol (/usercontrols/CultivContactForm.ascx)
The type 'CultivContactForm.CultivContactForm' is ambiguous: it could come from assembly 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\85f608c1\7ae2fc52\App_Code.nmfedzwl.DLL' or from assembly 'C:\inetpub\wwwroot\build\bin\CultivContactForm.DLL'. Please specify the assembly explicitly in the type name.
2) I have gone through countless forums in order to resolve this. It appears that during the building of the project there is a temporary reference to a similar DLL file in the ..\Framework\.. location. Even if I rename the conflicting file, the error still appears. I have tried renaming the type to CultivContactFormTest.CultivContactForm in both the .ascx.designer.cs and the .ascx.cs without any luck (as this is what I'm working on here.... being a newbie).
3) Some forums have suggested deleting the Inherits="CultivContactForm.CultivContactForm" from the <% ... %> area in CultivContactForm.ascx file.
None of these things have worked for me.
I simply want to add a dropdownlist with REASONS FOR YOUR ENQUIRY being listed, the selection to be included automatically in their email as I had done via php outside of umbraco.
Any ideas please? (perhaps even pointing me in the direction of already clear wiki/forum on "how to extend .net macros"
Cheers, Adam
Hi Adam
When you made your build did you then copy the dll to the bin folder AND copy the user control as well?
If so...did you compile against the correct umbraco dll's?
/Jan
Hi Jan,
Yes to both the first 2 questions. I have followed the process below with the original code downloaded from Codeplex, and also after editing in my own code, with identical result.
I HAVE NOW GOT IT WORKING without CultivContactForm.dll from the \bin folder, but I don't know how it will work on a Live server due to step 9.
This is my process:
1) In MS C# 2008 Express I dragged the CultivContactForm.ascx, CultivContactForm.ascx.cs and CultivContactForm.ascx.designer.cs into a new project called CultivContactForm using the Class Library template..
2) Then I Add Reference to Recaptcha.dll, umbraco.dll, System.Web.dll v2.05 (v4.0 has '!' beside it for some reason) as expected in "using" section at the top of the .ascx.cs file.
(I have selected .Net Framework V4.0 and Integrated in the application pool in IIS - is this a possible conflict?)
3) I then add the DropDownList to the .ascx, .ascx.designer.cs, and the .ascx.cs files.
4) Save and Build Project.
5) Copy CultivContactForm.dll to \build\bin folder.
CultivContactForm.ascx to \usercontrols folder.
CultivContactForm.ascx.cs and CultivContactForm.ascx.designer.cs to \App_Code folder.
6) Create macro called CultivContactForm and select my .ascx as the .NET User Control file.
7) Add macro to my template.
8) Browse to page and hey presto... the Error: Error creating usercontrol (usercontrols/CultivContactForm.ascx)
The type 'CultivContactForm.CultivContactForm' is ambiguous: it could come from assembly 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\85f608c1\7ae2fc52\App_Code.yqdfgqks.DLL' or from assembly 'C:\inetpub\wwwroot\build\bin\CultivContactForm.DLL'. Please specify the assembly explicitly in the type name.
(occasionally this error is in the tracestack also: Master template is the same as the current template. It would course an endless loop!)
9) When I delete the new CultivContactForm.dll from the \bin folder the ambiguity apparently disappears, and IT WORKS!
So according to the error I need to "specify the assembly explicitly in the type name". How is this done?
I hope this makes it easy to 'guess' where I may be going wrong.
Cheers
Adam
Latest update:
I now have it working on the test environment: without the .ascx.designer.cs, and the .ascx.cs files in the \App_Code folder AND with the .dll file in the \bin folder.
(Fingers crossed it will work when live.)
Thanks for your assistance. :)
Cheers,
Adam
is working on a reply...