Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the sender's name in an email

Status
Not open for further replies.

Reggie1977

Programmer
Nov 10, 2003
7
IE
Hi,

I want to set the sender's name in an email but I am having problems. Heres the code I am using:

USE C:\EMAILS\EMAILS.DBF IN 0 ALIAS EMAILS

SELE EMAILS

loApp = CREATEOBJECT( "Outlook.Application" )
loMail = loapp.createitem( 0 )
WITH loMail
.recipients.ADD( "joe.johnson@o2.ie" )
.subject = "Customer Service Email"
.sender = "reggie1977@mydomain.com"
.body = ncemails.para1 + CHR(13) + ncemails.para2
.send()
ENDWITH

CLOS DATA

But I get an error message at .sender:

OLE error code 0x80020006: Unknown name.

I dont want my own name and email address appearing on the email, can anyone tell me where I am going wrong.

P.S. This is not for Spam emails if thats what you are thinking. Its a customer service app.
 
I believe that the sender's name has to be a valid name.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Outlook object modell you can find in docu for MS Office. On my PC it is in: "C:\Program Files\Microsoft Office\Office\1029\VBAOUTL9.CHM"
HTH
 
Reggie1977,

I believe you are looking for .SenderName and it is not used the way you are using it.

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Try
.sentonbehalfofname=anyname@ISP.com

instead of:

.sender = ...

Michael Ouellette
mouellette@tpg.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top