Error with SMTP

aboomar
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;
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;
0
Comments
-
Any body there0
-
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.0 -
//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 mail0 -
Do you have Table 409 (SMTP Mail Setup) setup correctly ?
If so, what error are you getting?0 -
Thanks Xypher
Now i ask about link in mail0 -
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)0 -
Attachment (FileAttached) does not exist or can not be accessed from the program.
This is the error message with any kind from files0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions