Capaldi, who stars as foul-mouthed government spin doctor Malcolm Tucker in hit BBC show The Thick of It, appears in an internet viral video alongside stars including Ricky Gervais, Ray Winstone and Ed Byrne.
The video has been created to support Edinburgh-based charity Macmillan Cancer Support's Cancertalk Week.
In the video, the actor says: "If you or anyone else you know has any fears or worries about cancer, talk to Macmillan.
"There are times when you shouldn't open your mouth, but this week isn't one of them."
Capaldi also filmed a message in character as hard man Tucker, saying: "The whole world would run a lot better if everyone shut their mouths, but there are times when you shouldn't open your mouth and times when you should. This is the week to get on the phone. Do as you're told. Talk."
Macmillan decided to dedicate its Cancertalk Week, from 18-24 January, to encouraging men to open up because they are often reluctant to ask for help.
Macmillan's director in Scotland, Elspeth Atkinson, said: "Men often feel they need to be the strong ones and keep quiet about how they are really feeling.
"This can make dealing with cancer even tougher."