Hi All,
i've problem about sending CDO mail and i am getting mail error like below
what is wrong there ?
TIA
1429-OLE Dispatch exeption code 0 from . The server rejected one or more recipients address.The server reponses 553 sorry that domain is not in my list allowed rcpthosts(#5.7.1)
* mail sending codes
Select ckodu,cadi,email From Addbs(m.gcdata03)+'cari' Into Cursor CrsResult
Do Form get_mail_recipents
Local lcRecipents,lcToList
lcToList = Sys(5)+Curdir()+[tolist.txt]
lcRecipents = Filetostr(m.lcToList)
xserver= Alltrim(arrmail[1,1])
xaccount= Alltrim(arrmail[1,2])
xreply= Alltrim(arrmail[1,3])
xto = m.lcRecipents
xcc=Alltrim(arrmail[1,5])
xbcc=Alltrim(arrmail[1,6])
xfrom=Alltrim(arrmail[1,7])
xsubject=Alltrim(arrmail[1,8])
xbody=Alltrim(arrmail[1,9])
xattach=Sys(5) + Curdir() + LcTiffFileName
Set Procedure To prg\cdo_mail Additive
=SendMailViaCDO(xserver,xaccount,xreply,xto,xcc,xbcc,xfrom,xsubject,xbody,xattach)
* cdo_mail.prg codes
Function SendMailViaCDO
Lparameters tcServer,tcAccountName,tcReplyAddress,tcTo,tcCC,tcBCC,tcFrom,tcSubject,tcTextbody,tcAttachment
Local LcServer,LcAccountName,LcReplyAddress,LcTo,LcCC,LcBCC,LcFrom,LcSubject,LcTextbody,LcAttachment
Wait Window "Please wait...e-mail sending via CDO .........." Nowait
LcTo=tcTo
LcCC=tcCC
LcBCC=tcBCC
LcFrom = tcFrom
LcSubject=tcSubject
LcTextbody=tcTextbody
LcAttachment=tcAttachment
#Define cdoBasic 1
#Define cdoNone 0
LcServer = tcServer
LcAccountName = tcAccountName
LcReplyAddress = tcReplyAddress
cdoMessage = Createobject("CDO.Message")
cdoConfig = Createobject("CDO.Configuration")
confFields = cdoConfig.Fields
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = m.LcServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = .F.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpaccountname") = m.LcAccountName
.Item("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = m.LcReplyAddress
.Item("http://schemas.microsoft.com/cdo/configuration/smtpuserreplyemailaddress")= m.LcReplyAddress
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoNone
.Update
Endwith
With cdoMessage
.Configuration = cdoConfig
.To = LcTo
.CC = LcCC
.BCC = LcBCC
.From = LcFrom
.Subject = LcSubject
.TextBody = LcTextbody
.AddAttachment(LcAttachment)
.Send()
Endwith
Store .Null. To cdoMessage,cdoConfig
Wait Window "e-mail has been succesfully send via CDO ........." Nowait
Endfunc
* below codes creating tolist.txt file on get_mail_recipents form.sendmail()
Select email From (Thisform.mGRID1.RecordSource);
Where llselected=.t. ;
And ;
If _Tally = 0
Messagebox('there is no selected any record...',16,_Screen.ActiveForm.Caption)
Return
Endif
Set Safety Off
Local lcRecipentList,tolist
lcRecipentList=[]
tolist=SYS(5)+CURDIR()+[tolist.txt]
For ix=1 To Alen("emails")
lcRecipentList = lcRecipentList+Trim(emails[ix])+";"
Endfor
m.lcRecipentList = Left(m.lcRecipentList,Len(m.lcRecipentList)-1)
Strtofile(m.lcRecipentList,m.tolist)