Solved

How do you use Persists Email dll from code behind?

Posted on 2004-09-06
13
748 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

838 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