Solved

How do you use Persists Email dll from code behind?

Posted on 2004-09-06
13
744 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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,…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

914 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

14 Experts available now in Live!

Get 1:1 Help Now