[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do you use Persists Email dll from code behind?

Posted on 2004-09-06
13
Medium Priority
?
756 Views
Last Modified: 2011-09-20
I'm having troubles using persists email api in ASP.NET   I've copied their code verbatium from their website, but it doesn't work.  
The following is the code that to me should would just fine, however it doesn't.    I get two errors...

1.  'ASPEMAILLib.IMailSender' denotes a 'class' where a 'variable' was expected
2.  No overload for method 'Send' takes '0' arguments             <-- This error is because the send function says it needs an object to send.. let so IMailer.send(object PATH)   But the examples from their support site doesn't ever show this.     ???  What does in there...



ASPEMAILLib.IMailSender objMail;
objMail = ASPEMAILLib.IMailSender;
objMail.Host = "sendmail.brinkster.com";
objMail.MailFrom = "errorreporting@mydomain.com";
objMail.FromName = "Error Reporting";
objMail.AddAddress("myaddress@hotmail.com",null);
objMail.Subject = "Reporting Errors, SIR";
objMail.Body = "<HTML><BODY>";
objMail.Body += Message;
objMail.Body +="</BODY></HTML>";
objMail.IsHTML = 1;
objMail.Send();

DOes anyone have a working version of how to use this API and send mail from a function in code-behind?  
Thanks,

btw.  Yes the dll is referenced in VS.NET and it's registered on my server.
0
Comment
Question by:Arron_S
  • 8
  • 5
13 Comments
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 11994063
Arron_S,
Try this :
eg:

using ASPEMAILLib;

ASPEMAILLib.IMailSender objMail;
objMail = ASPEMAILLib.MailSender();
objMail.Host = "sendmail.brinkster.com";
objMail.From = "errorreporting@mydomain.com" ' Required field
objMail.FromName = "Error Reporting";
objMail.AddAddress("myaddress@hotmail.com",null);
objMail.Subject = "Reporting Errors, SIR";
strMsg = "<HTML><BODY>";
strMsg +="Testing";
strMsg +="</BODY></HTML>";
objMail.Body=strMsg;
objMail.IsHTML=True;
objMail.Send(Missing.Value);

-More details, you can check it at : http://www.aspemail.com/manual_02.html
0
 

Author Comment

by:Arron_S
ID: 11994306
Nope .. I still get   'ASPEMAILLib.IMailSender' denotes a 'class' which is not valid in the given context  
and this is my code..    I've visited aspemail.com and I've tried everything there but It still doesn't work..  There documentation isn't consistant anyway..  I'm just trying to find a single working example...

ASPEMAILLib.IMailSender objMail;
objMail = ASPEMAILLib.IMailSender();
objMail.Host = "sendmail.brinkster.com";                  
objMail.From = "support@digital-panhandler.com";
objMail.FromName = "Error Reporting";
objMail.AddAddress("pennyfx54@hotmail.com",null);
objMail.Subject = "Reporting Errors, SIR";
objMail.Body = "<HTML><BODY>";
objMail.Body += Message;
objMail.Body +="</BODY></HTML>";
objMail.IsHTML = 1;     <---  this has to be an INT..  don't ask me why, that's just the way the programmed the class
objMail.Send(null);
0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 11999317
Arron_S ,
Can i see your complete error code here? I'm try to figure out what happend there. If you resolved the problem, you can ask for refund your point as well at CS Area.
http://www.experts-exchange.com/Community_Support/
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Arron_S
ID: 12031397
Here's the compile time error:
c:\inetpub\wwwroot\ASPtestapp\SessionTracker.cs(149): 'ASPEMAILLib.IMailSender' denotes a 'class' which is not valid in the given context


private void SendMail(string Message)
{
ASPEMAILLib.IMailSender objMail;
objMail = ASPEMAILLib.IMailSender();   <<-- Intelisense puts its squiggles under .IMailSender()
objMail.Host = "sendmail.brinkster.com";                  
objMail.From = "support@digital-panhandler.com";
objMail.FromName = "Error Reporting";
objMail.AddAddress("pennyfx54@hotmail.com",null);
objMail.Subject = "Reporting Errors, SIR";
objMail.Body = "<HTML><BODY>";
objMail.Body += Message;
objMail.Body +="</BODY></HTML>";
objMail.IsHTML = 1;
objMail.Send(null);
}
0
 

Author Comment

by:Arron_S
ID: 12031411
Oh and this us the Dll I'm including.

using ASPEMAILLib;
0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 12043964
Arron_S ,
sorry for the delay due to my busy schedule recently.
Can i know what is code of line 149? Again, you can ask for refund the point if you resolved the problem at CS Area.
0
 

Author Comment

by:Arron_S
ID: 12046286
Line 149 is
objMail = ASPEMAILLib.IMailSender();   <<-- Intelisense puts its squiggles under .IMailSender()
0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 12054780
Arron_S ,
This line :
objMail = ASPEMAILLib.IMailSender();
try change to this instead:
objMail = new ASPEMAILLib.IMailSender();
-Also, dont forget put the ASPEMAILLib.dll into your project /bin. Solve the problem?
0
 

Author Comment

by:Arron_S
ID: 12057234
Nope, Now i get this error


LINE 148   ASPEMAILLib.IMailSender objMail;
LINE 149   objMail =  new ASPEMAILLib.IMailSender();  <--  'new' has the squiggles under it now


c:\inetpub\wwwroot\ASPtestapp\SessionTracker.cs(149): Cannot create an instance of the abstract class or interface 'ASPEMAILLib.IMailSender'

0
 

Author Comment

by:Arron_S
ID: 12057254
Okay..  this compiled

ASPEMAILLib.IMailSender objMail;
objMail  = new ASPEMAILLib.MailSenderClass();


Why did persists name it that????  I've never seen this before..
0
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 1500 total points
ID: 12065501
Arron_S ,
>>Why did persists name it that????
-I'm not sure about it maybe different dll version cause the context problem. More details, you can ask them for any doubt about their dll. For me, i will choose to use System.Web.Mail (.nt build in function for emailing transaction). So far, it work well for me and i dont need to pay extra money for 3rd party control for this purpose. If you interest with system.mail, you can check their FAQ : http://www.systemwebmail.com/ 
0
 

Author Comment

by:Arron_S
ID: 12080753
Yeah I know, but my host Brinkster disabled the use of system.web.mail and makes it's customers use 3rd party email dll's.  I don't know why..  Then it provides out of date and incomplete documentation on how to use them, not to mention their tech support is useless.  
0
 

Author Comment

by:Arron_S
ID: 12080756
Thanks for your help,  You lead me in the right direction
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question