Error with SMTP

aboomaraboomar Member Posts: 47
please guys i need help i am try to send mail with smtp but i have error message ( unknown class returned........)
I think the error in 'Microsoft CDO For Exchange 2000 ibrary'
because i wok on XP


// objEmailConf -- 'Microsoft CDO For Exchange 2000 ibrary'.Configuration
// objEmail -- 'Microsoft CDO For Exchange 2000 Library'.Message
// flds -- 'Microsoft ActiveX Data Objects 2.5 Library'.Fields
// fld -- 'Microsoft ActiveXData Objects 2.5 Library'.Field


IF ISCLEAR(objEmailConf) THEN
CREATE(objEmailConf);
flds := objEmailConf.Fields;
fld := flds.Item('http://schemas.microsoft.com/cdo/configuration/smtpserver');
fld.Value('MAIL.domain.com');
fld := flds.Item('http://schemas.microsoft.com/cdo/configuration/smtpserverport');
fld.Value(25);
fld := flds.Item('http://schemas.microsoft.com/cdo/configuration/sendusing');
fld.Value(2);
flds.Update();


IF ISCLEAR(objEmail) THEN CREATE(objEmail);
objEmail.Configuration :=objEmailConf;
objEmail.From := 'mailfrom@hotmail.com';
objEmail."To" := 'mailto@hotmail.com';
objEmail.Subject := 'Subject';
MBody:='SMTP';
IF MBody <> '' THEN
objEmail.TextBody := MBody;
objEmail.Send;

Comments

  • aboomaraboomar Member Posts: 47
    Any body there
  • XypherXypher Member Posts: 297
    If you're attempting at sending email via SMTP protocol why use Exchange automation?

    Check out this link: http://www.mibuso.com/forum/viewtopic.php?t=20740


    The manner in which you are going about this process appears (primarily based on the example code) rather extensive. Using multiple automations and issuing 'settings' request statements; it seems as though you're going a little out of your way to accomplish something so simple.
  • aboomaraboomar Member Posts: 47
    //SMTPVar = Codeuint 400

    SMTPVar.CreateMessage('Name','mail@hotmail.com','mail@hotmail.com','STPM','New',True);
    SMTPVar.Send;

    I need to know the error in this code and what the code i need to add
    link in mail
  • XypherXypher Member Posts: 297
    Do you have Table 409 (SMTP Mail Setup) setup correctly ?

    If so, what error are you getting?
  • aboomaraboomar Member Posts: 47
    Thanks Xypher

    Now i ask about link in mail
  • XypherXypher Member Posts: 297
    Now by link do you mean URL? Or an attachment?

    URL: If the last parameter of CreateMessage function is set to TRUE then the text within the email is treated as HTML

    Attachment: There should be a very simple self exclamatory function provided in CU 400 to include an attachment (Not sure if you can add multiple)
  • aboomaraboomar Member Posts: 47
    Attachment (FileAttached) does not exist or can not be accessed from the program.


    This is the error message with any kind from files
Sign In or Register to comment.