> I want to redirect the undernoted message using
YAHOO instead of
OUTLOOK.
>
> Pls assist by reframing the undernoted using YAHOO.
>
> thanks
>
>
>
>
>
> LOCAL oOUTLOOKOBJECT, oNameSpace, oDefaultFolder, olMailItem, MyOLItem ,Lnsucc
>
> lidno = alltrim(thisform.idno1.value)
>
> select * from vpaymast where vpaymast.idno = lidno;
> into cursor leav_mast
>
> select leav_mast
>
>
> Txt = " "
> TXT= chr(13) + chr(13)
> txt =' '+ txt +DTOC(DATE()) + chr(13) + chr(13)+ chr(13)
> txt =' '+ txt + alltrim(leav_mast.FNAME)+" "+alltrim(leav_mast.lname) + CHR(13)
> TXT =' '+ TXT + leav_mast.DEPT +" "+ leav_mast.DEPTNAME + CHR(13)
> TXT =' '+ TXT + leav_mast.BRANCH+" "+ leav_mast.BRANAME + CHR(13) + CHR(13)
> TXT =' '+ TXT + "DEAR, "+ leav_mast.FNAME + " " + CHR(13) + CHR(13)
> TXT =' '+ TXT + thisform.LEV_NAME1.VALUE + CHR(13)
> TXT =' '+ TXT + "-------------------------" + CHR(13)
> TXT =' '+ TXT + "YOU ARE DUE TO TAKE YOUR " +ALLTRIM(Thisform.LEV_NAME1.VALUE)+ " FROM " +DTOC(Thisform.fromdate1.value);
> + " TO " + DTOC(thisform.todate1.value)+CHR(13)
>
> TXT=' '+ TXT+ " COVERING A PERIOD OF " +ALLTRIM(STR(THISFORM.DAYSPEAD1.VALUE)) + " DAYS." + CHR(13) + CHR(13)
>
> txt =' '+ txt + "YOU ARE TO REPORT BACK TO DUTY ON " +DTOC(thisform.todate1.value)+'.' + CHR(13) + CHR(13)
>
>
> IF Thisform.lev_name1.value = "ANNUAL LEAVE"
> txt =' '+ txt + "MANAGEMENT WISHES YOU AN ENJOYABLE LEAVE." + chr(13)
> ENDIF
>
> ****************************************
> ****************************************
>
> oOutLookObject = CREATEOBJECT("OUTLOOK.APPLICATION")
> oNameSpace = oOutLookObject.GetNameSpace("MAPI")
> *oDefaultFolder = oNameSpace.GetDefaultFolder(olFolderContacts)
>
> MyOLItem = oOutLookObject.CreateItem(olMailItem)
>
> With MyOLItem
> .Subject = "Leave Advice"
> .To=leav_mast.email && "
Bob@yahoo.com"
> .Cc=leav_mast.sup_mail && "
kdonkor@yahoo.com"
> .Bcc=leav_mast.email && "
CARL@hotmail.com"
> .body = txt
> .Display()
> Endwith
you can use CDO for this.
you need to know the outgoing port for yahoo server and to check if it uses SSL
i have successfully sent mails by using gmail & indiatimes but was not able to
send by yahoo, that may be because of restrictions in my office to access yahoo server.
you may try this code if you can do it.
LOCAL loConfig AS CDO.Configuration, loFlds AS Object, loMsg AS CDO.Message
loConfig = CREATEOBJECT("CDO.Configuration")
loFlds = loConfig.Fields
WITH loFlds
*- Set the CDOSYS configuration fields to use port 25 on the SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
*- Enter name or IP address of remote SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.yahoo.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587 && for gmail use 465 or 467
*- Assign timeout in seconds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 20
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = .t.
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 && for gmail it is 1
.Update()
ENDWITH
*- Create and send the message.
loMsg = CREATEOBJECT("CDO.Message")
WITH loMsg
.Configuration = loConfig
.To = "sur200@indiatimes.com"
.From = "username@yahoo.com"
.Subject = "This is a test of CDO sending e-mail"
.HTMLBody = "This is the HTML content of the mail message"
TRY
.Send()
MESSAGEBOX("Email Sent Successfully")
CATCH TO oerr
MESSAGEBOX(SUBSTR(oerr.message,AT(":",oerr.message)+1,LEN(oerr.message)))
ENDTRY
ENDWITH
-----------------------------------------------------------------------------------------------
Regards
Surinder Singh
Email:
sur200@indiatimes.comCheck my blog for details:
http://weblogs.foxite.com/sur200----------------------------------------------------------------------------------------
*If you understand what you're doing, then you're not learning anything.