Need Help in HTML Email

I had written the function for sending the HTML mail, its working fine but only ‘FROM’ field is not coming when sending the mail, In the inbox of the mail receiver its giving the name of the person who has signed the agent and not the name of the person who send this mail(FROM field).

I dont want to select the optiion Run As Web User, since I am using the Authors field in my work flow, if i do that it will work fine.

following is my code

Function SendHTMLMail(strTo As String, strCC As String, strBcc As String, strSubject As String, strBody As String, strPrincipal As String, strDisplaySent As String, strFrom As String, strSentBy As String, strDisplayFrom_Preview As String, strtempDisplaySentBy As String)

Set stream = dbasesession.CreateStream



dbasesession.ConvertMime = False	

Set docMail = dbaseThis.createDocument()

docMail.Form = "Memo"



Set mimeBody = docMail.CreateMIMEEntity



Set mimeHeader = mimeBody.createHeader("Subject")	

mimeHeader.SetHeaderVal(strSubject)



Set mimeHeader = mimeBody.createHeader("From")	

mimeHeader.SetHeaderVal(strFrom)



Set mimeHeader = mimeBody.createHeader("To")	

mimeHeader.SetHeaderVal(strTo)



Set mimeHeader = mimeBody.createHeader("CC")	

mimeHeader.SetHeaderVal(strCC)



Set mimeHeader = mimeBody.createHeader("BCC")	

mimeHeader.SetHeaderVal(strBCC)



Set mimeHeader = mimeBody.createHeader("Principal")	

mimeHeader.SetHeaderVal(strPrincipal)



Set mimeHeader = mimeBody.createHeader("DisplaySent")	

mimeHeader.SetHeaderVal(strDisplaySent)



Set mimeHeader = mimeBody.createHeader("SentBy")	

mimeHeader.SetHeaderVal(strSentBy)



Set mimeHeader = mimeBody.createHeader("DisplayFrom_Preview")	

mimeHeader.SetHeaderVal(strDisplayFrom_Preview)



Set mimeHeader = mimeBody.createHeader("tmpDisplaySentBy")	

mimeHeader.SetHeaderVal(strtempDisplaySentBy)



stream.WriteText strBody



Call mimeBody.SetContentFromText(stream,"text/html;charset=UTF-8", ENC_NONE)	



Call docMail.Send(False)

End Function

TIA

Pravesh.

Subject: Need Help in HTML Help

Did you try setting From field in docmail ike docmail.from=session.username before call docmail.send(false).

hope this helps…

Cheers

Sri.

Subject: RE: Need Help in HTML Help

This all doesnt help. I also had manny problems with this.The only solutions i found is to create a special sign id and sign the agent with this id.

Subject: RE: Need Help in HTML Help

Thanks for the reply.

But I need the same name ‘FROM’, and will go with the simple mail and not the HTML mail.

Pravesh.

Subject: RE: Need Help in HTML Help

How about adding the SMTPOriginator field, set to the same value as the FROM field?

HTH

Bruce

Subject: RE: Need Help in HTML Help

I recommend using the Principal field. I have posted some of my code below.

memo.Form = “Memo”

memo.ReplyTo = “Grants@College.Edu”

memo.Principal = “Grants@College.Edu@College”

memo.From = “Grants@College.Edu”

memo.Subject = “Your Grant Proposal has been Submitted.”

Of course, the word “College” is referring to my location here. Just replace that with your desired info.