I\'m creating an email a friend type system where I need our mail server to send emails from the user of the site to their friend, i.e. from fred@gmail.com, to tony@gmail.com.
If gmail doesn't fail miserably, you have no way to suppress this warning.
Google is in control of both accounts and therefore knows, that this mail wasn't send by fred using their infrastructure.
There was used some third party infrastructure (yours) and this is all this warning is about.
You can set an arbitrary email address as "from" and Google has no knowledge if this is legitimate use (if fred really wrote the message). Anyone could have written that message. Normally fred would use Googles infrastructure to send mails and then they would know its him.
A cleaner solution would be to put your email address ("noreply@company.com") as from header (that would be honest) and set fred@gmail.com as reply-to header (so he gets the replies).