SendMail Issue


Posted by Dave C on April 26, 2001 4:15 PM

We run Excel 97, Netscape Mail & Navigator 4.5

After writing the following macro:

ActiveWorkbook.SendMail("dave.c@XXX.XXX.nz",(Subject),(false))

I get a message back saying 'Compile error Expected ='

If I remove the Subject and return receipt options, so the macro reads:

ActiveWorkbook.SendMail(dave.c@XXX.XXX.nz) no message appears, but when I attempt to run the macro, I get a Netscape message:

'An error occurred while sending mail. The mail server responded: Invalid syntax. Please check the message recipients and try again.'

I know the Email address is correct!

Posted by Dax on April 28, 2001 9:12 AM


Hi,
You don't need to use the parentheses. You should only use them when the method you are using is going to return a value. This should work:-

Sub TestSend()
Subject = "test"
ActiveWorkbook.SendMail "dave.c@XXX.XXX.nz", Subject, False
End Sub

Hope this helps,
Dax.



Posted by Matt on May 15, 2001 7:20 PM

When I ran the similiar code under Netscape 4.5, I've received the same error message. And I have tested a few more, still the same. But when I upgraded my Netscape to 4.7, the exact same code worked.

Hope this helps.

Matt