|
If your code works fine with google as you say, then i suspect there is a configuration difference between your official mail server and google.
What is your official mail server?
Does it use the same port?
Does it use the same authentication?
Answer those and we might be able to help more.
P.S. if you are developing a new application, or are learning, then it is time to move to a .Net language. VB6 is almost obsolete, and should only be used to support legacy apps, not new stuff.
|
|
|
|
|
it been a while since i looked at VB6. but where do you confure the mail server ? i would start looking there as i cant see this info in the code provided
|
|
|
|
|
Hey Kannan,
Use this class, which i use for the same from VB
Option Explicit
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
'Delivery Status Notifications
' In order to use the Delivery Status Notifications (Return
' Receipt and Delivery Disposition requests)
Const cdoDSNDefault = 0 'None
Const cdoDSNNever = 1 'None
Const cdoDSNFailure = 2 'Failure
Const cdoDSNSuccess = 4 'Success
Const cdoDSNDelay = 8 'Delay
Const cdoDSNSuccessFailOrDelay = 14 'Success, failure or delay
Private mvarCONNECTION_TIMEOUT As Integer 'local copy
'local variable(s) to hold property value(s)
Private mvarMail_Password As String 'local copy
Private mvarMail_UserName As String 'local copy
'local variable(s) to hold property value(s)
Private mvarSMTP_ServerName As String 'local copy
Private mvarSMTP_ServerPort As Integer 'local copy
'local variable(s) to hold property value(s)
Private mvarMail_Attachments As Variant 'local copy
'local variable(s) to hold property value(s)
Private mvarMail_FromName As String 'local copy
'local variable(s) to hold property value(s)
Private mvarMail_To As String 'local copy
Private mvarMail_Cc As String 'local copy
Private mvarMail_Bcc As String 'local copy
'local variable(s) to hold property value(s)
Private mvarMail_Subject As String 'local copy
Private mvarMail_Message As String 'local copy
Public Property Let Mail_Message(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_Message = 5
10 mvarMail_Message = vData
End Property
Public Property Get Mail_Message() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_Message
10 Mail_Message = mvarMail_Message
End Property
Public Property Let Mail_Subject(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_Subject = 5
10 mvarMail_Subject = vData
End Property
Public Property Get Mail_Subject() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_Subject
10 Mail_Subject = mvarMail_Subject
End Property
Public Property Let Mail_Bcc(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_Bcc = 5
10 mvarMail_Bcc = vData
End Property
Public Property Get Mail_Bcc() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_Bcc
10 Mail_Bcc = mvarMail_Bcc
End Property
Public Property Let Mail_Cc(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_Cc = 5
10 mvarMail_Cc = vData
End Property
Public Property Get Mail_Cc() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_Cc
10 Mail_Cc = mvarMail_Cc
End Property
Public Property Let Mail_To(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_To = 5
10 mvarMail_To = vData
End Property
Public Property Get Mail_To() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_To
10 Mail_To = mvarMail_To
End Property
Public Property Let Mail_FromName(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_FromName = 5
10 mvarMail_FromName = vData
End Property
Public Property Get Mail_FromName() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_FromName
10 Mail_FromName = mvarMail_FromName
End Property
Public Property Let Mail_Attachments(ByVal vData As Variant)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_Attachments = 5
10 mvarMail_Attachments = vData
End Property
Public Property Set Mail_Attachments(ByVal vData As Variant)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.Mail_Attachments = Form1
10 Set mvarMail_Attachments = vData
End Property
Public Property Get Mail_Attachments() As Variant
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_Attachments
10 If IsObject(mvarMail_Attachments) Then
20 Set Mail_Attachments = mvarMail_Attachments
30 Else
40 Mail_Attachments = mvarMail_Attachments
50 End If
End Property
Public Property Let SMTP_ServerPort(ByVal vData As Integer)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.SMTP_ServerPort = 5
10 mvarSMTP_ServerPort = vData
End Property
Public Property Get SMTP_ServerPort() As Integer
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.SMTP_ServerPort
10 SMTP_ServerPort = mvarSMTP_ServerPort
End Property
Public Property Let SMTP_ServerName(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.SMTP_ServerName = 5
10 mvarSMTP_ServerName = vData
End Property
Public Property Get SMTP_ServerName() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.SMTP_ServerName
10 SMTP_ServerName = mvarSMTP_ServerName
End Property
Public Property Let Mail_UserName(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_UserName = 5
10 mvarMail_UserName = vData
End Property
Public Property Get Mail_UserName() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_UserName
10 Mail_UserName = mvarMail_UserName
End Property
Public Property Let Mail_Password(ByVal vData As String)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.Mail_Password = 5
10 mvarMail_Password = vData
End Property
Public Property Get Mail_Password() As String
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.Mail_Password
10 Mail_Password = mvarMail_Password
End Property
Public Property Let CONNECTION_TIMEOUT(ByVal vData As Integer)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.CONNECTION_TIMEOUT = 5
10 mvarCONNECTION_TIMEOUT = vData
End Property
Public Property Get CONNECTION_TIMEOUT() As Integer
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.CONNECTION_TIMEOUT
10 CONNECTION_TIMEOUT = mvarCONNECTION_TIMEOUT
End Property
Public Sub MailMessage()
Dim iMsg As CDO.Message
Dim iConf
Dim Flds As Variant
'Set iMsg = CreateObject("CDO.Message")
10 Set iMsg = New CDO.Message
20 Set iConf = CreateObject("CDO.Configuration")
30 Set iConf = New CDO.Configuration
' iConf.Load -1 ' CDO Source Defaults
40 iConf.Load cdoDefaults, ""
' Set Flds = iConf.Fields
50 With iConf.Fields
60 .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
70 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mvarSMTP_ServerName
80 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = mvarSMTP_ServerPort
90 .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
100 .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
110 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = Trim(mvarMail_UserName)
120 .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = Trim(mvarMail_Password)
130 .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = mvarCONNECTION_TIMEOUT
140 .Update
150 End With
160 With iMsg
170 Set .Configuration = iConf
180 .From = Trim(mvarMail_FromName) & "<" & Trim(mvarMail_UserName) & ">"
190 .Sender = Trim(mvarMail_UserName)
200 .To = Trim(mvarMail_To)
210 .CC = Trim(mvarMail_Cc)
220 .BCC = Trim(mvarMail_Bcc)
' Note: The reply address is not working if you use this Gmail example
' It will use your Gmail address automatic. But you can add this line
' to change the reply address .ReplyTo = "Reply@something.Com"
230 .Subject = Trim(mvarMail_Subject)
240 .TextBody = Trim(mvarMail_Message)
250 .AddAttachment mvarMail_Attachments
260 .Fields("urn:schemas:httpmail:importance") = 2
270 .Fields("urn:schemas:mailheader:X-Priority") = 1
280 .Fields("urn:schemas:mailheader:disposition-notification-to") = Trim(mvarMail_UserName)
290 .Fields("urn:schemas:mailheader:return-receipt-to") = Trim(mvarMail_UserName)
'.DSNOptions = cdoDSNSuccessFailOrDelay
' ' .MDNRequested = True
300 .Fields.Update
310 .send
320 End With
330 Set iMsg = Nothing
340 Set iConf = Nothing
End Sub
Have a Happy Day.
|
|
|
|
|
Short, Snappy and does the trick!
I still prefer mailto:
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Thanks GOD the question got answer only. its like
"Man who run in front of car get tired"
"Man who run behind car get exhausted"
SOFTDEV
If you have knowledge, let others light their candles at it. [ Let's work to help developers, not make them feel stupid ]
|
|
|
|
|
I AM USING VB 2008 AND WANT TO PROGRAM MY PARALLEL PORTS.
I HAVE COPIED THE CODE FOR VB 2005 AND IT GIVES ME AN ERROR ON THE OUT PUT
COMMAND.
WHAT CHANGES DO I HAVE TO MAKE?
THANKS
JACK
|
|
|
|
|
STOP SHOUTING FOR STARTERS!!!!!
And may be also tells us what the error message states........
And maybe post some code that is throwing the exception.........
from there the peeps on here might be able to help.
|
|
|
|
|
Jack,
Thanks For your Private Message Reply; I would just like to share it with the rest of the CodeProject users, as i feel that your response was inappropriate, considering my original message was merely seeking more information and repeating some of the points from "How To Ask A Question" at the top of this forum"
Jack W. Pulling wrote in a private message:
YOUR REPLAY WAS SOMEWHAT OUT OF LINE I BELIEVE.
I WAS REFERING TO THE CODE AS POSTED ON THIS SITE.
WOUNDERING IF SOMEONE ELSE HAD THE SAME PROBLEM WHEN USING VB 2008.
MORE DETAIL WOULD BE ISSUED IF REQUESTED.
SIMPLE QUESTIONS WILL DO.
JACK
Some point in response to your private message;
1) Your still SHOUTING.....please stop, if you can't help it, may get someone to fix your CAPS LOCK key.
2) What code are you referring, i haven't seen any when i had read your question, maybe link to it then
3) I was requesting more detail
4) I think my questions were simple
So, if you want to play silly buggers, then fine. But i suggest you maybe WIND YOUR NECK IN AND JOG ON!
Is that fair, i think so.
Have A Nice Day!
|
|
|
|
|
Jack W. Pulling wrote: WHAT CHANGES DO I HAVE TO MAKE?
Plenty.
|
|
|
|
|
Stop, take a step back from the keyboard.
Programming is a skilled job (or at least I thought) and requires extensive training before operating the controls, after all you wouldn't just jump into a commercial aircraft and attempt to fly it. Leave this kind of work for professional programmers who understand programming and hardware.
Two heads are better than one.
|
|
|
|
|
I am somewhat at a loss.
Normally I would crank up the old grey matter and launch a tirade about Shouty messages, the Appalling Messages, the Poor Spelling and the General Rudeness of your communications.
For some reason my little brain cannot encompass the incredible ineptitude you have shown in one simple set of messages.
But let me attempt to throw light upon this matter, to elucidate if you prefer, to educate and to inform.
First, Do not type in capitals, it does not add emphasis to your words, merely makes you look like either a 5 year old or a complete dickhead, you may select which one of those you wish us to consider you to be.
Second, To think that VB5 and VB2008 code are freely interchangeable is just unbelievably stupid.
This indicates you have no knowledge of programming or that your knowledge is based on watching films like WarGames and Hackers. They are different languages , similar, yet with subtle differences in commands, syntax and grammar.
Third, Rudeness never fares well in this site. Do not command or expect immediate aid to your problems, it will not be forthcoming.
Fourth, Do not attempt projects that are beyond your level of skill. If you have said you can do a job and then cannot complete it, you look like a dick, and after what we have all read here, I think the concensus is that you are a dick.
Fifth, and finally, please remember that all communication should be entered into via the fora provided, personal emails are a courtesy, used with exception and for specific reasons, not for general communiques.
Thanks for taking the time, now go away and grow up and return in a newer, more polite and less shouty and ignorant form.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Well put Dave!
i like the last line the most and want to take it for my signature
Thanks for taking the time, now go away and grow up and return in a newer, more polite and less shouty and ignorant form. - Dalek Dave
|
|
|
|
|
he did not even mention VB5.
|
|
|
|
|
Dalek Dave wrote: Second, To think that VB5 and VB2008 code are freely interchangeable is just unbelievably stupid.
This indicates you have no knowledge of programming or that your knowledge is based on watching films like WarGames and Hackers. They are different languages , similar, yet with subtle differences in commands, syntax and grammar.
Errm Dave. Step away from the keyboard - he said VB2005, which is very similar to VB2008.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Please confirm...
Is 'similar to' the same as identical?
No?
My argument stands.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Dalek Dave wrote: Is 'similar to' the same as identical?
No?
Well, if he's just targetting the .NET 2 features then, yes they are identical.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Excuse me, I am being Semantic here!
Plus all my other points are valid.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
i am developing a project with VB6 and Firebird 2.1.3. When i update the table tblPartyMaster and examines the adoRsParty!PartyID which is a primary key,autoincrement, unique identifier returns 0 (Zero) instead of New PartyID Value which i need for further processing.
With adoRsParty
.AddNew
!CompanyName="Sample Company"
.Update
msgbox !PartyID
End With
I have create a Generator for PartyID
and a Before Insert Trigger on table tblpartyMaster as
CREATE TRIGGER TR_AI_TBLPARTYMASTER_PARTYID FOR TBLPARTYMASTER
ACTIVE BEFORE INSERT
POSITION 0
AS
BEGIN
NEW.PARTYID = GEN_ID(GEN_TBLPARTYMASTER_PARTYID, 1);
END
Please Suggest me some ideas for fetching the PrimaryKey (PartyID) Value of newly inserted row.
Expecting some advice or ideas or guidance
With regards
K.Senthil Babu
|
|
|
|
|
You can use a storedprocedure, I think trigger is not convenient. Just use an Output parama in your code. If you face any problem please let me know.
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
From my Delphi and Interbase days I remember that the methodology the OP is using (before insert trigger and GEN_ID) is the recommended way of doing things.
Unfortunately I have never tried to access Interbase/FireBird from VB and therefore am unable to help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Md. Marufuzzaman,
I Created a procedure instead of Trigger along with the generator and called the procedure from the front end for autonumber, it works fine.
Thanks A Lot.
|
|
|
|
|
You are most welcome..
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Explain reading contents and writing contents from a file using APS object stream.
|
|
|
|
|
You have posted four homework questions which demonstrate a lack of enthusiasm (on your part) to do the minimum amount of work set by your professor/teacher. If you really cannot understand these questions you should discuss your future with your teacher.
It's time for a new signature.
|
|
|
|
|
Or concentrate on his maths, he will need to make sure he puts the right number of McNuggets in the box.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|