?
Solved

How do you use Persists Email dll from code behind?

Posted on 2004-09-06
13
Medium Priority
?
753 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month10 days, 3 hours left to enroll

762 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