VBA email ignore Name Correction

hajiali

Well-known Member
Joined
Sep 8, 2018
Messages
626
Office Version
  1. 2016
Platform
  1. Windows
Hello all

with the following code:

VBA Code:
    With oMail
        .BCC = Range("X1").Value
        .Subject = Range("X3").Value
        .Body = "Hello " & Range("X2") & "," & vbCrLf & "Attached files are the Ramp bid and " & Range("A1") & "." & vbCrLf & _
            Range("X4") & " you may use this bid form, however, please make sure you print, sign and drop it in the Bid box. " & vbCrLf & _
            "Do not email your bid over." & vbCrLf & _
            "Printed copies have also been posted. Good Luck!!" & vbCrLf & _
            vbCrLf & _
            vbCrLf & _
            "Thank you," & vbCrLf & _
            "SSO TEAM"
        .Attachments.Add WB.FullName
        .Attachments.Add bidfile
'        .Display
        .Send

Im getting a error message at Send function because outlook generates Name Correction. the Value in cell "X1" is in a loops so it changes after the send.

the value in "X1" contains employee number which is link to there actually corporates email. for example instead of typing John.smith15@company.com one can type John smith Employee number E123456 in To/CC/BCC to send him an email.

My issue arise when an employee has short employee number ex: E3924 outlook wants to use name check asking to select one of the following;
e3924
e39240
e39241
e39245
e39242
e39247
e39244
e39248
e39249
e39243


Although I just needed to send it to E3924. The code works great when the Employee number is unique. Had the "X1" value been e39240 it would had send it without name checking. What im needing is to be able to bypass the Name checking and just send the email to the actually value. I have tried changing the setting in outlook under FILE>OPTIONS>MAIL and unchecking the box for automatically Name Checking still does not work. any suggestions is greatly appreciated.

Thanks
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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