473,840 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User defined type not defined

Hello all,
I am trying to write a prog that autamatically sends emails ...
Here is what I have done so far
In the module section I have put this:

Public Function SendEmail(email As String, subject As String, body As
String, attach As String)

Dim Mail As MailSender
Set Mail = New MailSender
Mail.Host = "relay.skynet.b e"
Mail.From = "my************ *@myprovider.be "
Mail.AddAddress (email)
Mail.subject = subject
Mail.body = body
Mail.AddAttachm ent (attach)

Mail.Send

End Function

Then in the program I assign values to the variables email,subject and body
Next I call the function ...
x = SendEmail(email , subject, body + Chr(13) + "Test", "c:\log.txt ")
on running it I get this err-message:
User defined type not defined
How do I solve this , Can anybody help me with that ?
Any suggestions very much appreciated

Ronny Sigo
Nov 12 '05 #1
2 8011
What is MailSender? To declare something like that, you either need to have
a reference set to an ActiveX component by that name, or else have a Class
with that name in your application.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Ronny Sigo" <ro********@exa mple.invalid> wrote in message
news:3f******** *************** @reader1.news.s kynet.be...
Hello all,
I am trying to write a prog that autamatically sends emails ...
Here is what I have done so far
In the module section I have put this:

Public Function SendEmail(email As String, subject As String, body As
String, attach As String)

Dim Mail As MailSender
Set Mail = New MailSender
Mail.Host = "relay.skynet.b e"
Mail.From = "my************ *@myprovider.be "
Mail.AddAddress (email)
Mail.subject = subject
Mail.body = body
Mail.AddAttachm ent (attach)

Mail.Send

End Function

Then in the program I assign values to the variables email,subject and body Next I call the function ...
x = SendEmail(email , subject, body + Chr(13) + "Test", "c:\log.txt ")
on running it I get this err-message:
User defined type not defined
How do I solve this , Can anybody help me with that ?
Any suggestions very much appreciated

Ronny Sigo

Nov 12 '05 #2
Hi Ronny,

Reply via google so someone else may have already responded...

I would say that you have no reference to the MailSender server thus
Access cannot create the object.

Goto Tools > References and reference the appropriate library. You
should be able to see the MailSender object in your object browser
once it referenced. Intellisense should also work with the object.

Alternatively check out the CreateObject and GetObject methods. This
will allow you to use late binding - ie you don't need to reference
the library.

Peter

"Ronny Sigo" <ro********@exa mple.invalid> wrote in message news:<3f******* *************** *@reader1.news. skynet.be>...
Hello all,
I am trying to write a prog that autamatically sends emails ...
Here is what I have done so far
In the module section I have put this:

Public Function SendEmail(email As String, subject As String, body As
String, attach As String)

Dim Mail As MailSender
Set Mail = New MailSender
Mail.Host = "relay.skynet.b e"
Mail.From = "my************ *@myprovider.be "
Mail.AddAddress (email)
Mail.subject = subject
Mail.body = body
Mail.AddAttachm ent (attach)

Mail.Send

End Function

Then in the program I assign values to the variables email,subject and body
Next I call the function ...
x = SendEmail(email , subject, body + Chr(13) + "Test", "c:\log.txt ")
on running it I get this err-message:
User defined type not defined
How do I solve this , Can anybody help me with that ?
Any suggestions very much appreciated

Ronny Sigo

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2005
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the main features of modules, namespaces, and User-Defined types. The text above was copied from page 31. --------------------------------------------------------
13
10456
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I change the parameter data types to the actual data type such as varchar(10), etc., the stored procedure takes less that a second to return records. The user defined types are mostly varchar, but some others such as int. They are all input type...
3
2799
by: Vivek Sharma | last post by:
Hi, I have created a dropdownlist as a web user control. I am using its multiple instances on the webpage. How do I access the selectedValue of each instance? All the instances have different IDs. Thanks Vivek
2
3026
by: paul meaney | last post by:
All, myself and another developer have been staring blankly at a screen for the past 48 hours and are wondering just what stunningly obvious thing we are missing. We are trying to load up 2 or more user controls dynamically by adding to a placeholder defined in page_load. I've included the sample code for how we are accessing one. The user controls are not rocket science - just a few text boxes with public accessor properties. We've...
2
2549
by: Les Stockton | last post by:
In VB6 you had a Type and End Type to define your own data types. Are the only ways to do this in VB.Net with enums, struct and class. How's the best way to define user defined types?
6
7619
by: karthi | last post by:
hi, I need user defined function that converts string to float in c. since the library function atof and strtod occupies large space in my processor memory I can't use it in my code. regards, Karthi
2
1687
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I think if the object type of the control is not System.Windows.Forms.xxx, then it is a user-defined control. But how to tell the type of the user-defined control: Composite(User), Extended, and Custom?
6
2666
by: JLupear | last post by:
I have written a code (a translation of my first one) that is not working. I did a user defined function that is used on 'onsubmit'. It should total the value from the form selections and immediately return a numeric value to an alert box for the user to see. Then after the user clucks on the 'OK' button on alert box the form data is further processed by a 'PHP' script. I have posted the user defined function below and after the next 'code'...
1
4576
by: Mikael Vehkajärvi | last post by:
Hello I am running ASP.NET (C#) using Oracle (PL/SQL, provider ODP.NET 11.1.0.6.20) and I have a procedure which at the moment returns a table of records. The code below demonstrates this. TYPE R_OutData_tab IS RECORD ( ... ); TYPE OutData_tab IS TABLE OF R_OutData_tab INDEX BY BINARY_INTEGER; PROCEDURE PROPERTY_GET (tOutData OUT <packagename>.OutData_tab);
1
4523
by: remya1000 | last post by:
i'm using VB.net 2003 application program. i'm trying to convert a VB6 program to VB.NET. The VB6 code i'm trying to convert is shown below. declared g_Share() array in module and trying to add values to it inside form. VB6 (Code inside Module) 'Global type array to hold printer info. Public Type OShare PrinterName As String
0
9856
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9698
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10657
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10299
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7836
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5684
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.