The user name should be the name of the profile you use to login. The password should be the one that is used for that particular profile. Normally, these would both be left empty unless you have different profiles setup for mail. Also, take out the refresh.
BTW, I have a MAPI class that will do all of this for you - it's in the files section here at UT or on my website.
>Some of my code here:
>
> THIS.oSession.NewSession = .T.
> THIS.oSession.UserName = "user"
> THIS.oSession.Password = "pass"
> THIS.oSession.REFRESH()
> THIS.oSession.SignOn <--- Debugger show this line as an error
> THIS.oMessage.SessionID = THIS.oSession.SessionID
> THIS.oMessage.Compose
> THIS.oMessage.MsgSubject = "Subject line here"
> THIS.oMessage.MsgNoteText = cString
> THIS.oMessage.RecipDisplayName = "
email@email.com"
> THIS.oMessage.Send(0)
> THIS.oSession.SignOff
>
>
>The error message is: "OLE IDispatch exception code 0 from MapiSession: Login has failed.."
>
>?????
>
>Thanks again!