Sending an email: 'customlogging' works but not on my own

Ask general questions here.
Florian
Posts: 75
Joined: Fri Jul 27, 2012 12:57 pm
Location: France (Lyon)
Contact:

Sending an email: 'customlogging' works but not on my own

Post by Florian » Tue Oct 02, 2012 4:11 pm

Hello,

I am configuring a test case where an email is sent if the is any problem.
I searched on this forum and read a blog article dealing with that topic :
http://www.ranorex.com/blog/customizing-ranorex-reports

I downloaded the project file. When I try it, it works well.
Now, I try to configure the same thing for my project, but it doesn't work ...

I added the 'MailLogger.cs' file to my project, try to use the same code in 'program.cs' but when I ty to rebuild the solution, here is the error I get:
The type or namespace name 'HttpUtility' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) (CS0234) - C:\Users\f.brouillet\Documents\Ranorex\RanorexStudio Projects\CheckRuntimeLDLC.ConvertedToC#\MailLogger.cs:283,54
And then, if I delete this piece of code, I get those error for the 'program.cs' file:
- The name 'MailLogger' does not exist in the current context (CS0103) - C:\Users\f.brouillet\Documents\Ranorex\RanorexStudio Projects\CheckRuntimeLDLC.ConvertedToC#\Program.cs:63,13
- The type or namespace name 'MailLogger' could not be found (are you missing a using directive or an assembly reference?) (CS0246) - C:\Users\f.brouillet\Documents\Ranorex\RanorexStudio Projects\CheckRuntimeLDLC.ConvertedToC#\Program.cs:64,41
- The type or namespace name 'MailLogger' could not be found (are you missing a using directive or an assembly reference?) (CS0246) - C:\Users\f.brouillet\Documents\Ranorex\RanorexStudio Projects\CheckRuntimeLDLC.ConvertedToC#\Program.cs:64,13
- Argument 3: cannot convert from 'System.DateTime' to 'string' (CS1503) - C:\Users\f.brouillet\Documents\Ranorex\RanorexStudio Projects\CheckRuntimeLDLC.ConvertedToC#\Program.cs:66,54
- The best overloaded method match for 'Ranorex.Report.LogHtml(Ranorex.ReportLevel, string, string)' has some invalid arguments (CS1502) - C:\Users\f.brouillet\Documents\Ranorex\RanorexStudio Projects\CheckRuntimeLDLC.ConvertedToC#\Program.cs:66,13
Please help me ... I am really lost!
How can I add such a feature to my project? I only want to send an email if there is an error. It would be great if I could send the whole report, but why does it not work??

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Sending an email: 'customlogging' works but not on my own

Post by Support Team » Tue Oct 02, 2012 4:27 pm

Hello,

You are getting this message because you haven't added the System.Web assembly to your project, HttpUtility Class.
Please also take a look at the following forum post, it could be useful for you: Sending zipped report and summary per email.

Regards,
Markus
Ranorex Support Team
.
Image