Solved

How do you use Persists Email dll from code behind?

Posted on 2004-09-06
13
742 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:Arron_S
Comment Utility
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
Comment Utility
Oh and this us the Dll I'm including.

using ASPEMAILLib;
0
 
LVL 29

Expert Comment

by:David H.H.Lee
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

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

Expert Comment

by:David H.H.Lee
Comment Utility
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
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for your help,  You lead me in the right direction
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now