Email address identifier in CDO

corquando

Board Regular
Joined
Jan 8, 2009
Messages
82
Greetings, Supreme Council.

Rich (BB code):
            With Flds
                .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
                = "MY-MAILSERVER.us.int.com"
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
                .Update
            End With
 
            Subj = "Important Documentation"
            EML = Range("B" + CStr(i))
            ID = Range("A" + CStr(i))
            strbody = ""
            Call TextBody(i, strbody)
            Atch1 = ""
            y = 0: Do Until Range("A" + CStr(i + y)) <> ID: y = y + 1: Loop
            Arr = 0
            With iMsg
                Set .Configuration = iConf
                .To = EML
                .CC = ""
                .BCC = "Me@MyMail.com"
                .From = "THE REALLY MARVELOUS COMPANY"
                .Subject = Subj
                .HTMLBody = strbody
 
                For j = i To i + (y - 1)
                    If Arr = 1 Then
                        DoxName = Range("D" + CStr(j))
                        Atch1 = "G:\Huge\Medium\Small\" + DoxName + ".pdf"
                        Arr = 0: GoTo 1
                    End If
                    DoxName = Range("C" + CStr(j))
                    Atch1 = "G:\Huge\Medium\Small\" + DoxName + ".pdf""
                    If Range("D" + CStr(j)) <> "" Then Arr = 1: j = j - 1
1                   .AddAttachment (Atch1)
                Next
                .Send

As I'm sure some have already surmised, I'm getting a "501 5.5.4 Invalid Address" error message because the sender address, "THE REALLY MARVELOUS COMPANY," is not in standard Who@what.ext format.

What I'm up against is that The Powers want the outgoing emails to say "THE REALLY MARVELOUS COMPANY" in the From: field; or, more specifically, they do not want the name of our company's return email address, because we are working as a management proxy and the client wishes that to remain less-well-known; our 3-character company name is the domain to and from which all emails flow, so not having it in the From: address is key to keeping them happy, and thus, me employed.

Is there a way, and I hope that only my panic keeps me from seeing it, that I can put "THE REALLY MARVELOUS COMPANY" in the From: field, have the program recognize it and say, "Aha! What he really means is 'TheClientsServiceOffice@TRMC.com'," and have the emails sent with the organization identifier instead of the actual source address in the From: field?

Thanks in advance.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Do you mean:
Code:
.From = "THE REALLY MARVELOUS COMPANY< TheClientsServiceOffice@TRMC.com>"
?

Remove the space after the "<" in your code. I've had to include it to prevent HTML rendering by the forum software.
 
Upvote 0
Well, yes but no.

It came out THE REALLY MARVELOUS COMPANY[ManagementProxyCompany@MPC.com] in the From: field, so it did add what I wanted but did not remove what I did not want.

Any progress is good progess . . . so thans for that. I'll keep tyring.
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,879
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top